If you're getting the nod, you're in the "Men's Club." Just nod back, it's just a general acknowledgement that you're both men and that he respects you, on some level, as his peer in gender. I've never nodded in the restroom or been nodded at, or I might think a guy was trying to hook up with me (depending on the place)

. Men's restroom culture is pretty straightforward, don't look at anyone but yourself, minimal eye contact/talking; get in, get out. So yeah, unless someone gave you a nod, I wouldn't nod in the restroom. But other places are pretty much fair game.
EDIT: About verbal communication alongside the nod, I haven't actually done it to a stranger, but a "Hey, man," or something easy to utter while passing by would be fine. It's especially acceptable if you know the guy.