If so, why isn't it part of the "standard" WWII narrative? If not, why might Richard Pipes have claimed this in "Communism: A History?" He frequently quotes primary sources for states of mind and subjective experiences, but he also makes a lot of claims in a somewhat off-hand way.
Richard Pipes' legacy as a historian is very controversial, to say the least. While many of his peers take his work seriously, Richard Pipes' visceral bias toward socialism paired with his employment by the CIA during the Cold War means that many of his claims are taken with caution. Historians Sheila Fitzpatrick, Ronald Grigor Suny, Alexander Rabinowitch, and particularly Peter Kenez have described Pipes' ideological bent in academic reviews and their own work.
Sheila Fitzpatrick notes in "Revisionism: A Retrospective" that Pipes had an impression of an American society in the 1930s and '40s as passively pro-Soviet, and that he had a duty to push back on this perceived sympathy to communism through his research. According to his own memoirs, Pipes believed that many rival academics (particularly those who arose after him, in the 1970s and '80s) were advancing a pro-Soviet agenda and even behaving in a manner he described as "familiar from the history of Bolshevism."
Stephen Kotkin writes in Stalin: Paradoxes of Power, Lenin pursued a pro-German policy, first as a matter of acquiescing to German demands to get a much-needed peace agreement, and later as a way to attack the Versailles world order, since neither the USSR nor Germany benefitted from it. Stalin's later collaboration with the Reichswehr was similar; Weimar Germany and the USSR had a great deal in common, and a big part of that commonality was the aspiration to "remedy" the borders as they stood.
Going beyond that book's scope now. In the spirit of changing the borders occurred the later joint invasion of Poland and the USSR's seizure of the Baltic states. This is not, however, to say that Stalin supported the Nazis from the beginning; this was a turnaround in previously anti-Nazi policy, dictated by Stalin's geopolitical ambitions, in a transformation which occurred after Stalin's attempt at creating a wider coalition failed. Hitler's astonishing reversal of anti-Soviet policies in order to reach the Molotov-Ribbentropp Pact occurred for largely the same reasons (as outlined in Adam Tooze's The Wages of Destruction); he had hoped that the Western European powers such as the United Kingdom and France would either form a wider anti-Soviet coalition with him, or let him conduct his conquests in the east unmolested. As his expansionist policy soured relations with Germany's western neighbors, it became a geopolitical necessity to instead ally with the Soviet Union at least for the time being.