Is it possible to run 32-bit code in a machine with 64-bit processor?
Yes. This is handled in Windows via WOW64, for example.
Now my question is vice-versa, Is it possible to run 64-bit code in a machine with 32-bit processor?
No. 64bit code would require a 64 bit instruction set, which won't be available on a 32 bit processor.
According this, it is possible to compile 64-bit code on a 32-bit machine.
You can compile code for other architectures, but not execute it. This lets you build code for different platforms than the currently executing platform, but executing it will not work.