Yes, you can put a compatible Xeon into an iMac, you just lose sleep capabilities. I run Macs Fan Control to keep it mild, low 30s idle, and it gets noisy when I am crunching Handbrake. 4 cores/8 threads.
I assume that is something in the ROM because an intel MacPro with Xeon seems to sleep...