If damage dealt to Phyrexian Hydra can’t be prevented (due to Leyline of Punishment, for example), it will be dealt as normal and won’t cause Phyrexian Hydra to put -1/-1 counters on itself.

Artwork
Loading artwork…
Phyrexian Hydra
Mirrodin Besieged · #85 · EN
Nonfoil—Foil—
Card rules
Infect (This creature deals damage to creatures in the form of -1/-1 counters and to players in the form of poison counters.)
If damage would be dealt to this creature, prevent that damage. Put a -1/-1 counter on this creature for each 1 damage prevented this way.
7/7
Rare · Illustrated by Mike Bierek
Format legality
Commander Legal
Duel Legal
Legacy Legal
Modern Legal
Oathbreaker Legal
Penny Legal
PreDH Legal
Vintage Legal
Alchemy Not Legal
Brawl Not Legal
Competitive Brawl Not Legal
Future Not Legal
Gladiator Not Legal
Historic Not Legal
Old School Not Legal
Pauper Not Legal
Pauper Commander Not Legal
Pioneer Not Legal
Premodern Not Legal
Standard Not Legal
Standard Brawl Not Legal
Timeless Not Legal
Tlr Not Legal
Rulings
Published rulings from the downloaded Scryfall catalog. Source card record · Rules and interactions
If multiple damage prevention effects, including Phyrexian Hydra’s, are attempting to prevent damage that would be dealt to Phyrexian Hydra, its controller chooses which to apply.