To answer your questions.
Yes the corolla came with a diesel, it was the CE71 or whatever the number was. It was used in the last rear wheel drive model both the change to front wheel drive.
I can't see anything too hard with swapping the motor into a ke3x to ke7x, just would have to do the usual things - engine and gearbox mounts, prop shaft, gearbox, etc. And brakes and suspension due to the heavier motor.
But all-in-all for the little bit of fuel economy that you'd get just wouldn't be worth the time, energy and cost that you'd put into it.