Language or similarity of CPUs does not really matter. All game code is designed and written around the platform hardware, its limitations, and quirks. So the only thing you can 'import' is code that does not rely on the hardware at all, i.e. some game logic. And even with that you can get issues, because NES code always rely on 2048 bytes of RAM available, while Atari 2600 can only have 128 bytes, thus totally different algorithms and approaches used to design game logic as well.