Reverse Phase Dimmer MOSFETs
GND is a term we can attach to any node on a circuit, usually it's a node with a lot of common connections and we usually refer to other voltages relative to that.

It's not uncommon to have a node called GND that is not at earth potential, it may be floating, or (as in this case) it might be at mains potential. 

Suppose we have a Vdd for the MCU used in the above circuit. If the Vdd is +5V relative to GND, it doesn't matter if GND is at 240VAC relative to earth, so long as Vdd-GND is 5V, that's what the MCU sees. 

Now if you were to touch one of the MCU pins to earth, then the MCU would be destroyed. Similarly if you were programming the MCU using an in-circuit emulator or programmer connected through a USB interface that is grounded, the MCU would be destroyed and possibly much more. 

When working with or developing this kind of circuit it's essential to use devices such as a mains isolation transformer or a USB isolator (or both for those of us who like belt-and-suspenders security).