1. Napoleon’s main enemy was the British while Hitler’s was the Soviets so Napoleon’s invasion of Russia was a distraction while for Hitler the war with the Soviets was the entire part of the war in the first place.
Hitler literally had to invade Russia, Napoleon didn’t. They have similarities in the middle and end, but they’re fundamentally different in that first aspect.
Uh, Hitler and Stalin were allies up until Operation Barbarossa. Stalin was happy to have his own sphere of influence and probably wouldn't have bothered Hitler as long as he didn't threaten him. There was no reason for Nazi Germany and the USSR to fight except Hitler's anticommunism and his delusions of grandeur.
Anyway, the main differences between the two invasions is the nature of military technology, which, yes, made a prolonged campaign in Russia far more sustainable in 1941 than it was in 1812.
The reason they were Allies was literally because Hitler didn’t want to fight a two front war in 1939 when he invaded Poland as while he didn’t think the British and French would declare war over invading Poland he didn’t want to risk it so he signed that pact with Stalin . Basically once the western front was completed and it was clear the British weren’t gonna be intimidated into surrendering, he basically decided to invade what he viewed as his main enemy from the start and that was the USSR.