That is true, But for that period of time both Hitler and Stalin (facism and communism) joined forces to achieve their individual goals. And that agreement had been formulated for some time prior.
The point is that no matter what form of Government that exist, even our own, They all will quickly sacrific their principals to achieve a given political objective which maintains or increases their political power or position.