Depends on what you mean by "program".
You would probably need a flash bios or SDRAM to load a program at boot time that would communicate over the serial port and upon command, transfer code in to memory, verify it, and then start it executing. A failsafe timeout that either interrupted or rebooted would probably not hurt ;-)
For some information on the serial port interface, see here. In that thread, Scott recommends highly against using the 8051 with the product that would later get named MATLAB Coder. Also possibly useful: this And a warning against the 8051: here