Voracious Wurm has a replacement effect that modifies how it enters the battlefield; thus, it would come into play with 0 +1/+1 counters, and you will gain two life.
If Voracious Wurm had a triggered ability (such as "When ~ enters the battlefield, put X +1/+1 counters on it, where X is the amount of life you've gained this turn"), however, you would be able to place the triggers on the stack in whatever order you choose, meaning you could gain 2 life and put 2 counters on, or put 0 counters on and gain two life.
Relevant rules:
603.3b If multiple abilities have triggered since the last time a player received priority, each player, in APNAP order, puts triggered
abilities he or she controls on the stack in any order he or she
chooses. (See rule 101.4.) Then the game once again checks for and
resolves state-based actions until none are performed, then abilities
that triggered during this process go on the stack. This process
repeats until no new state-based actions are performed and no
abilities trigger. Then the appropriate player gets priority.
614.1. Some continuous effects are replacement effects. Like prevention effects (see rule 615), replacement effects apply
continuously as events happen -- they aren't locked in ahead of time.
Such effects watch for a particular event that would happen and
completely or partially replace that event with a different event.
They act like "shields" around whatever they're affecting.
614.1d Continuous effects that read "[This permanent] enters the battlefield . . ." or "[Objects] enter the battlefield . . ." are
replacement effects.