Rogue allies (or, more precisely, rogue-target-enemies) have nothing to do with the situation. If the rogue is hidden from the enemy, Dodge does nothing. It doesn't impose disadvantage on the rogue's attack because the Dodge action says:
"When you take the Dodge action, . . . any attack roll made against you has disadvantage if you can see the attacker, . . . ."
If you can't see the attacker (because they have successfully hidden from you or are otherwise unseen), the Dodge action does not impose disadvantage on the attacker, and the advantage gained from being an unseen attacker is not canceled. The unseen attacker has advantage and, absent some source of disadvantage besides the ineffectual dodge action, has nothing to counter that. Attacking with advantage (whilst armed with a ranged or finesse weapon) means happy-sneak-attack-y rogue.
There are, as you said, usually ways to stop sneak attacks, but in the case of a hidden sniping rogue, the only options are to make the rogue no longer hidden or find a way to impose disadvantage on their attack with something other than dodge. Dropping prone would work, but with its own costs.