Is this DIY high voltage AC generator safe to use?
It seems that you think that the only thing that matters on a transformer specification is the transformer ratio, 240V:12V in this case and that you can apply 220 V to the 12 V winding. This is not the case.

The coil voltage rating is related to the magnetic flux in the core. The 12 V rating is that voltage which will not saturate the core. Exceeding that voltage will cause the core to saturate, the inductance of the coil to drop very low and if the fuse doesn't blow, the current will increase to a level that will burn out the transformer and possibly start a fire.

Even if you didn't have problems on the primary you would have problems on the secondary. The insulation is rated for 220 V operation but you are hoping for several kV. If you were able to generate these voltages the insulation would break down causing shorts on the secondary which would appear as a short on the primary due to transformer action. This again would lead to rapid overheating and possible fire.

As others have advised, stop now.