wont you short the 12V to gnd through Q1&2 when the opto is active?
No because both Q1 and Q2 will never turn on simultaneously.
When the opto-coupler is on Q1 is on and Q2 is off. When Q1 is on, Q2's emitter voltage will be 12V - 0.8V but its base voltage will be nearer 12V. Remember Q2 is a PNP transistor so its base voltage needs to be about 0.7V below the emitter to turn on.
is it really necessary for both Q1&2. if its me, i try to use Q1 or Q2 (but not both) only for switching the NMOS, correct me if wrong, i'm a newbie as well.
At higher speeds, two transistors are required to ensure that the MOSFET's gate is charged/discharge very quickly.
KTP,
There are several options.
I'd connect R2 to +12V and connect a transistor to short the bases of Q1 and Q2 to 0V.
Attached is another idea I came up with to solve a similar problem for someone on another forum. It used a P-MOS transistor but it's easy to change to to N-MOS. It has the advantage of only requiring two NPN-transistors to give a push-pull output with level shifting.