Hitler rose to power legally, although very shortly thereafter, with the burning down of the German Parliament building, the Reichstag, he imposed a sort of martial law and his reign of terror could then begin in earnest. His National Socialist Party had by then the majority in the legislature, so he could easily pass these measures that would soon begin to destroy his "1000 year Reich."
Stalin's assumption of power was different. He was a leading member of the Bolshevik movement based on Karl Marx and headed by Vladimir Lenin and Leon Trotsky. When Lenin fell ill in the early 1920's Stalin used his position in the Bolshevik Party to isolate Lenin in his sickbed. He soon controlled all access to the failing Lenin, and if Lenin wanted him to be successor to the helm of the Bolshevik movement, we have mainly only Stalin's word of that decision by Lenin. Of course there are documents for and against Stalin being Lenin's successor, but their validity has always been questionable.
And Trotsky, the other leader of the Bolshevik movement? Stalin had him effectively isolated and defamed Trotsky to the point he had to flee the nation for his own safety, yet it worked only temporarily. Stalin had him murdered in Mexico in 1940 - a Soviet agent stuck an icepick in his head
Neither men were natives of the nations they eventually ran. Stalin was from Georgia, his real name Jozef Jughashvili, and not a Russian as his name implies, Stalin being a variation on the Russian word for steel. Hitler was born in Austria, and while an ethnic German, he was not a citizen of Germany at birth.
In their politics they were remarkably similar - both men were fascists - Hitler was a political fascist, a mistaken label hung upon him as if