While looking for dimmer circuits, I stumbled upon the FL5160 Dimmer controller and it's specification at https://www.onsemi.com/pub/Collateral/FL5150-D.pdf The example schematic (for example, the three wire circuit on page 3) connects DC ground to the common terminals of two MOSFETs in series. It appears that when Q1 and Q2 conduct, there's no isolation between the AC mains and the DC part of the circuit.
Looking around, I see this is pretty common, for example, https://sound-au.com/project157.htm also has a 3 wire dimmer circuit that has the ground connected similarly.
Am I understanding this correctly ? Or something like a optocoupler is preferable here assuming dim would be controlled by a human operator ?