There are many modifications of this circuit.
What is the best value of the resistor that is inseries between optocoupler and the Arduino? (5 volts)
What is the best value for the resistor that is between the optocoupler and the TRIAC?
Do I need it at all?
Yes you do need the resistor from the Arduino to the Optocoupler otherwise you may fry the Arduino output, the optocoupler or both. 220Ω is a reasonable value but use a resister that will drive the LED in the optocoupler to about 10 to 20ma. I’m not sure about the value of the triac resister so I won’t comment on that.
I would not recommend this simple circuit to PWM an AC Load.
Below are some links to articles and circuits on how to use PWM for dimming lights. These will apply to a heater as well because it’s a resistive load like an incandescent light is. If there is a fan in this unit it’s possible that it may not work properly when PWMed and depending on what type it is it may be quite inductive. Also most of these circuits are changing the AC to DC so you will likely need to power it from the direct AC in. Lastly a heater will draw substantially more current than a light so you’ll need high current devices and heatsinks.
I think your referring to emulating a potentionmeter or pot.
If that's the case there are digital potentionmeter chips available that can be controlled via SPI or I2C. Just google "digital potentionmeter".
If you plan on using one of these to replace the pot in your dimmer then you have to check to see if any of the pots terminals are connected to the high voltage. Generally newer dimmers aren't like this but some older and really cheap ones were like this.
Old/cheap is not as important here. It is all about the kind of load I am trying to modulate.
LED lights, heaters and incandescent lights, motors of various kinds, all require a different kind of "modulation" device.
I want to use a "dimmer switch" on a 120watt heater that is PTC, so it never goes above 120watts and usually consumes a lot less power.
You can either phase control the Triac at 60 hz or zero cycle switch the Triac.
Either way , you need to detect the zero crossing points of the AC waveform and use this data to tell the Arduino when to switch the Triac on.