I don't know if Russia or indeed all of Earth was communist when Worf grew up, but the whole Klingon Empire was widely recognized by people of the 20th century as resembling the Soviet Union, which was nominally communist during the Cold War era of original Trek. Memory Alpha even mentions it. Mostly just because they were "the bad guys" I suppose.
The Klingons are a fairly obvious metaphor for the Soviet Union during TOS, right through to Star Trek VI.
In TNG, they largely stopped serving that purpose, though Roddenberry wanted Worf’s presence to indicate that the Federation had moved on from the war with the Klingons, similar to how the Cold War was coming to a close in real life.
(At that point, I don’t think they had worked out Worf’s backstory about being a Federation citizen from Russia.)