With Hitler, he wanted to put the German race on the forefront of the Earth, and to hell with the Jews and Slavs that stood in the way, though he did decide by the end that the Germans were not worth anything at all, and ordered Germany's destruction to Speer, who refused. Obviously he had extreme megalomania and a Messiah complex, not to mention being a genocidal psychopath, but I always felt he had an "altruistic" loyalty to his nation.
With Stalin, I can only get the feeling that he was a sociopathic opportunist who had no loyalty to any idea, country or people. He would have joined a Fascist Party if he knew it would make him the leader. He was Georgian, so he didn't have much loyalty to Russia as a nation, nor did he seem interested in spreading Communism when it went against Soviet interests.
So was there a big difference between the two on this, or did Stalin actually have some form of idealism within him?
The idea that Stalin was a blood thristy manic etc. is pretty prevalent but not really tenable. The idea that he was just an opportunist doesn't really explain the choices he made in either joining the Bolsheviks (a marginal group with limited prospects at the time) never mind how he ran the country. None of Stalin's collegues seem to have thought he was a nut case or disloyal, after all through the 1920s thet kept giving him more power.
Stephen Kotkin argues that Stalin was heavily motivated by ideology, whilr his tendency towards violent solutions to 'problems' is probably a result of a ruthless pragmatism, with a dash of incompentance, rather than a psychological flaw. Here is Kotkin on the topic of Stalin: https://youtu.be/3MzPzfEVjNE