You can pretty much (assuming it will fit) swap any engine for any other, the issue is how much work/adaptation will be required.
ECU will be different but if it has the same socket & input pin-out it could be easy, if not it could be hard.
The same could be true of ANY plug/socket/nut/bolt anywhere in the engine bay & the most (apparently) simple job can easily grow arms, wings, legs horns & turn into a nightmare.
This would beg me the question why?
If you just want an update it would be MASSIVELY simpler, quicker & cheaper to change the car.
At least doing it that way you don't then have the issue of insurance, because if you don't tell them, they will disown you when you need them the most and potentially cost you your sanity, wallet and even freedom massively.