I don't understand what you are asking exactly.
If you want to use mega16 in place of at89c2051 in an existing pcb then it can't be done because the don't match in pin count or pinout.
If you will make a new connection scheme and correct the code as well to be able to run in the new mcu then sure you can.
I think you cannot replace a 20-pin IC with a 40-pin IC,can you..???
If you want to use Atmega16 try building up your system according to its requirements...