A slight clarification:
In the forest the rogue likely has cover, one of the two (standard) things that allow hide checks. The other is concealment, which shadows/darkness provide. If the rogue in the unlit dungeon came into range of a monster with darkvision (standard 60 ft. range) and he had no cover then the rogue would not be allowed a hide check. If the rogue was outside of the monster's darkvision, 65 ft. or farther away, he would be allowed hide checks as normal, because he would then have concealment.
You can hide from creatures with darkvision, solely using darkness to grant concealment, as long as you are outside the range of the creature's darkvision. If you're within range, then you better have some cover around because the thing's gonna see you. That's why peeking around corners is good.