PWM to analog voltage conversion for communication between two microcontrollers
Is this a proper method to do PWM to analog voltage conversion?


Yes.


  Is there any way to improve the output accuracy of the STM32 and the
  detection accuracy of the ATtiny85 in this circuit design?


Use the highest available PWM frequency. Make the r/c time constant large enough that voltage ripple is less than the accuracy you need, but small enough that you don't need to wait too long for the voltage to settle.  

To reduce measurement noise, take multiple readings and average them. With a 10 bit ADC this can be done by simply accumulating (adding) 32 consecutive readings in a 16 bit Int, then dividing the result by 32.

If the PWM frequency is low and you need high accuracy the total acquisition time could be very long. The ADC will also introduce more errors due to noise and non-linearity. Don't expect to extract 10 bits from a 10 bit PWM! 


  Are the resistor and capacitor values are good enough for this use
  case?


Depends on the PWM frequency and required accuracy. The resistor value should be much higher than internal resistance variation of the PWM output port, but low enough to satisfy ADC input requirements. 1-10k is probably OK.  


  And what specific SMD parts could be used for this application? Like
  the type of capacitor, the voltage and capacitance rating, resistor
  type and sizes etc.


Sizes shouldn't matter in this case since the current and power dissipation is low. The capacitor should be rated for at least 4V, but if you use a multilayer ceramic (MLCC) type a much higher voltage rating may be needed to maintain capacitance over the working range.

Temperature and Voltage Variation of Ceramic Capacitors, or Why Your 4.7µF Capacitor Becomes a 0.33µF Capacitor