Yes, if they really need them. Lots of surgeons will try to avoid having to use the restroom by limiting fluid intake, but nobody’s going to deny them a bathroom break if they need to go. They simply "break scrub," do their business, and scrub back in.
To make them more manageable, some intense surgeries have different teams to handle different aspects. With this strategy, a day-long surgery can translate into only a few hours for any individual surgeon.