As to OP–I think you can meaningfully compare Hitler and Stalin. I think there’s some level of truth to the idea that "past a certain level of bad behavior, differentiating doesn’t mean that much, like both would be justifiable put to death if they had fallen into the hands of any kind of fair international tribunal. Since that is the ultimate punishment, the differences between their crimes in terms of severity and scope, while assessable, are probably not deeply meaningful.
However my position is Hitler was worse, with all the caveats I’ve given. To illustrate why let’s start first with the case against Stalin.
Stalin’s death count is estimated to be in the range of 3.3 million up to 9.8m depending on what you count. During the Cold War era Western scholarship frequently ascribed around 20m deaths to Stalin, which arguably trump Hitler’s unless you levy Hitler with the guilt of “general deaths from WWII due to him bearing the greatest individual culpability in starting the war.” However as Soviet archives got opened up in the 90s, and we had that 10 year gap where Russia was post-Soviet but pre-Putin, Western researchers got unprecedented levels of access to real data on the USSR and how it operated during the long Cold War.
What came out is that Stalin killed probably a good bit less than the 20m that was previously “presumed canon.” Stalin’s regime officially recorded 799,455 executions, 1.7m people who died in the Gulags, 390,000 deaths during dekulakization (forced resettlement) and 400,000 persons who died due to being deported from the USSR into bad circumstances.
That gets you to the 3.3m. But a huge wrinkle in that number is this includes both political prisoners and ordinary criminals, so the figures are a little less grim than they appear. Some of the figures like the Gulag deaths and deaths from resettlement and deportation are also difficult to assess because some % of those people likely died of conditions that would have killed them whether they had been put in the Gulag or not.
There is additionally 6.5m people who are estimated to have died in the Soviet famines, which some people also add to Stalin’s death count (there is a similar stance with Mao’s death count which includes a huge % of famine deaths.) How you want to weight those deaths and the level of moral guilt you assign for them is ultimately somewhat subjective. But I think the ~12m people who died in the concentration camps, which includes a very high % who were not guilty of any crime (including the 6m Jews who died in the Holocaust), and who were quite deliberately killed and thus we know they didn’t just have a heart condition that flared up in custody–seems to me to outweigh even the worst take on Stalin’s activity. The flipside is there’s an alternative take on Stalin’s crimes where you can argue he didn’t set out to cause a famine, perhaps you can blame his mismanagement for it occurring, but it would make little sense for a Soviet leader to do something that kills millions of his farmers and laborers. It is much more likely the famine was an unanticipated consequence and not deliberate. You can also argue that since the 3.3m “custodial deaths” of the Stalin era include common criminals, I think Stalin gets edged out by Hitler in terms of “bad behavior.” Refer back to my initial caveats that Stalin’s behavior even with the mitigating factors is still very bad, it would “max out” the punishment he would receive in any kind of just tribunal, so we’re talking about a differentiation that is not terribly meaningful philosophically.
There’s also question as to whether Stalin’s killings were primarily or significantly genocidal. Best evidence we have, the current definition of genocide which as a basic definition refers to group killing based on a group’s ethnicity, nationality, or religious beliefs, do not meaningfully line up with Stalin’s killings. There’s a Stanford history professor, Norman Naimark, who makes the argument that Stalin’s targeting of people based on their political beliefs and social class should be considered genocidal, and the definition of genocide should be broadened to include them. But as of now at least, there is not any sort of international consensus to calling such things genocide.