So you connected a 12 V power supply to the Arduino pin? Do you understand that is different from a relay?
To the extent that the microcontroller can safely drive the relay coil, when set to an OUTPUT, it switches either to ground or to 5 V. When it switches, whatever current the relay was passing from one supply line, is simply transferred to the other supply line. So there is no "voltage spike". Truthfully, people - even engineers - seem to become very confused about how inductors work.
The optocoupler has negligible gain. Common specifications give gains (CTR) in the order of 0.5 to at most 6. And that at much lower currents.
It depends. You referred to a "relay module".
Even with a gain of three (which is an edge case), an optocoupler is not appropriate for controlling a relay as it is not rated for 100 mA. Maybe if you use 24 V and a 24 V relay ...
But with the transistor (or FET) and "kickback" diode, there is no problem, so
it is not going to be an issue.
You do not switch the ground of an audio amplifier. And an IRF540 is not a logic-level FET.
Perhaps you should not be offering advice until you understand quite a bit more about all these things? Do a lot more reading on the forums here as it is often explained.