I'm not saying it cannot be done.
But I'm asking why it needs to be done in the first place.
240 volts AC will have a peak voltage of 338 volts. Because of reflected voltage and other voltage peaks, the switching Mosfet will have to withstand at least 600 volt. But with Mosfets, a Rds_on goes hand in hand with withstanding voltage, therefore, this same Mosfet, when operated at 10 volts (12 volts DC minus the bridge rectifier's drop) will have terrible conduction losses.
Same for the transformer...it will have to have a primary wire capable of conducting approximately 30 times the current requirement at maximum AC voltage.
And I haven't touched the start-up circuitry requirements.
The question is: why compromise a design so much? What voltage source exists that will output 12 thru 240 volts, at either AC or DC?