Execute Code sent over Serial
No, it's not possible as you describe it.

The Arduino's main chip, the ATMega328p, is what is known as Harvard Architecture.  This means that the Flash memory and RAM both occupy completely separate memory address spaces.  The CPU in the chip is only able to fetch its instructions from the memory space the Flash is connected to (the Instruction Bus) and not the memory space the RAM is connected to (the Data Bus).  This means it can only run instructions that are in Flash and not RAM.

It is possible to re-program the flash on the fly - after all, that's what the bootloader does, and while the actual act of reprogramming flash is fairly trivial, generating the instructions in the right way is far from trivial.

There are other options though.


Use an interpreted language.  I believe there are versions of BASIC available for the Arduino that would allow you to upload a program through the serial port and execute it.
Define a protocol (or use an existing protocol) to send pre-defined control commands to the Uno.  Firmata might be of use here.