Some classrooms/schools are more flexible than others.
In my experience, in elementary schools you are not allowed to leave the children unattended. Depending on the staffing of the school, getting coverage when you need it may be a problem. It won't matter if you have a disability if there is no one available at that time to cover for you. Some schools have you ask the teacher in the classroom next door to stand just outside both doors and moniter two classrooms.
The staff at my former school were very considerate of the teacher undergoing chemo, which was short term; but eventually got annoyed covering for the teacher with a bladder problem, long term. They were all great people, they just got frustrated at the constant unpredictable disruptions.
I am not trying to discourage you; you just need to do a little research into the policies of the schools you may be interested in.
Have you considered special education? The classroom is more likely to have a bathroom right there, plus, you usually have at least one other adult around. Other possibilities would be the 'speciality' teachers like resource, library, speech etc. They do pull out programs with small groups for shorter periods of time allowing you to easily use the bathroom between groups.
It is easier with older students, you can usually get away with leaving them for a few minutes. Plus, middle and high schools usually have discrete periods so you can go between classes if you are near the faculty bathroom.
Teaching is the best job I've ever had!