Resources are indeed the key. Napoleon took Moscow, but Alexander had enough country to retreat and gather supplies. So Napoleon had to retreat, had to take the same road his army has already ransacked. And without provisions, without precious calories his army froze to death in a relatively mild weather.
Stalin had successfully managed first to trade technologies for resources with Germany and then, after the war begun, to move the war production behind the Urals. While Germany was quickly running out of resources, the USSR was producing more and more supplies fro their troops each day. In the end, even the united European war production was not enough to keep up. It is questionable though how close Hitler was to actually winning that war given that the war production was moved in advance.
As for the nuclear war: I don't see how any side could emerge victorious from such an ordeal. Economy, not nukes is the weapon of choice. The troops are merely following to finish a weakened country.