As written, the ranger gains advantage on all initiative rolls and on (most) first-round attacks.
The relevant portion of the class feature Natural Explorer is simple:
- You have advantage on initiative rolls.
- On your first turn during combat, you have advantage on attack rolls against creatures that have not yet acted.
You have advantage on initiative rolls. Is it an initiative roll? Then you've got advantage.
You're attacking someone? Did they act yet? No? You've got advantage on that attack.
This clearly contradicts the intent of the class. Or does it...?
The opening line of Natural Explorer sets the tone:
You are a master of navigating the natural world, and you react with swift and decisive action when attacked.
It seems like you're reading onto that line the proviso "react with swift and decisive action when attacked in the natural world." But it's not there in the text. (To be fair, that's the read I gave it at first, too.)
Most of the features of the new ranger do tie into the nature theme. But this isn't the only that's just a pure buff to combat: Fleet of Foot, Vanish, and Feral Senses all would apply (as written) equally-well in an urban or dungeon environment as in overland.
The intro to that UA clearly states that the class--both as a whole and its features considered severally--was just seen as weak and unfun. It's your call as to whether they've gone too far pumping some power and fun into the Ranger, but that's exactly what the authors were trying to do.