Five Nights At Freddy's
Impossible, you would have to sneak directly through either Foxy and Bonnie's hallway or Chica and Freddy's hallway. And then you'd have to cross the main area to get the bathrooms, where sometimes they might be in there. Assuming the cameras aren't portable Foxy would likely just charge straight at you but either way, FNAF 1 is a high chance of "hell no, just pee in a cup"
Five Nights At Freddy's 2
Using YouTuber CuppaTeaExe's Minecraft build of the FNAF 2 map I'll be assuming the bathroom is directly across the hall. Unlike previously in FNAF 1 the animatronics apparently aren't even persuing you (quote from phone guy saying the animatronics don't have a proper night mode and are just searching for the party). You could just wear your Freddy Mask as you cross the hallway and if Foxy shows up just well, bring your flashlight with you. But be sure to wind up the music box before departing (if the cameras aren't portable) and it should be a breeze to wees.
Five Nights At Freddy's 3
Considering Fazbear Frights is just an attraction it probably doesn't have a bathroom within the building itself, and with the phantoms in your way, Afton wandering around and since we KNOW that the cameras this time have no chance being portable because they hinge from the right side than just rising from wherever you are. This is probably impossible again, even if you escaped the building Springtrap could just wait for you return.
Five Nights At Freddy's 4
This one gets a bit complicated, so I'll split it into two parts.
Night Version
This one is sadly impossible, every one of the animatronics gathers up in the halls so you would not be able to escape them, and is there even a bathroom in this twisted version of the house? For this instance, I'll just assume that a bathroom is at the end of the FNAF 4 house's left hall. But still, you'd have to swerve through Bonnie to get there, and Chica and Foxy if they are also currently at the very back. And similarly to FNAF 2, you'd have to hurry up so you don't get attacked by Freddy immediately upon return.
Day Version
But... that isn't the real layout of the house, this gets into theory territory and I don't really want to get into it so I'll just leave this as-
Five Nights At Freddy's 5: Sister Location
Even though I don't know where a bathroom could be in the bunker (besides the proposed one in the FNAF 4 room), at least we can surely assume it does have one. Even if Circus Baby and gang were targeting you, you could probably still make it just depending on what night it was.
Five Nights At Freddy's 6: Pizzeria Simulator
If you needed to go during the simulator phase, you'd be a-ok. Surely this place has a bathroom and there are no threats during that phase. But when you're in the actual horror part, you wouldn't even be able to access the bathroom in the cramped vent space. This weird question is about getting to the actual bathroom, not cups or pants. Considering the salvage phase has you directly across from an animatronic you are SUPPOSED TO KEEP YOUR EYES ON, leaving for a bathroom break would most likely not work and once you return you'd just find the "I'm already inside" sign either way... which would mean you'd survive? But not successfully.
Five Nights At Freddy's 7: Ultimate Custom Night
Wouldn't the pee just evaporate if this was really hell? Whatever...
The player, William Afton, seems to be either dead or in some kind of coma. I'll go for a coma since dead people don't have to pee. When in a coma, people can't pee normally so either we have to settle for (quick Google search) a urinary catheter or hope that we can project some kind of signal to tell the doctors to carry us to the proper toiletries... which is not happening. Also considering this is supposed to be hell by the one [we] should not have killed, they probably would not include a bathroom as punishment. So this is impossible, but not because of the danger.
Five Nights At Freddy's 8: Help Wanted, FNAF 9: Security Breach, and FNAF 10: Help Wanted 2 [LIGHTNING ROUND]
FNAF 8: It's VR (canonically), just take your headset off and go to the bathroom.
FNAF 9: There would be bathrooms dotted all over the place, just hop into Freddy and make your way to one of the many rooms.
FNAF 10: Also VR (canonically) I think??? Correct me if I'm wrong I fell behind on the most recent lore. But if I'm right I'd be the same thing as FNAF 8
The End?