I have no issue pissing in front of anyone. Like other men, anything other than that is strictly private.
For men, the restroom is like a holy temple. No one speaks. No one acknowledges another. If you bump into another coming out as you're going in the door, you simply nod, and if you're being vocal, you grunt a greeting. It's perfectly acceptable to do nothing but walk past.
There are a few exceptions that bring chuckles and stuff, but they are far and few between. Not habitual at all.
People that treat the public restroom like their home disgust me. If a building has 3 floors of public restrooms, it is reasonable to walk in, see a stall door closed, and leave and go to another floor for an empty restroom. I hate it when someone walks in and takes a seat right next to me. I will wait down the hall, go up the stairs to another floor or go back to my desk and wait longer if need be. I find the cleanest and least used restroom and use that one. That is called "the safe haven". I refer to it as such in my mind when I'm embarking on my trek to the toilet
At my last job, I tracked traffic over a month and found that generally, the 3rd floor is least used and has the least number of occupied offices. That was my safe haven from then on.
Men are weird about that stuff. My wife didn't get it for a long time too. She would just barge in and I'd be like WTF GET OUT. Now she respects my privacy, but will occasionally knock then enter to get something, then leave quickly while sticking her tongue out at me or something. LOL