I'm really sorry to read this. I have a son with a lot of anxiety too. Have you been bullied? Often the bathroom represents a place where things like that can happen. What about proactively scheduling your bathroom breaks? Go before school. Go at lunch. Go at any other time that is easy like gym, before band, (or whatever your schedule allows). What about talking to your school counselor? They are so helpful and WANT to be there for students struggling. It's not embarrassing and even an email to them could begin to set in motion some helpful things at school for you. Often there is a pattern for when we have to go so if it happens around the same tie each day, you can have it set up ahead of time with the teacher. Make sure not to take advantage (go straight in and return right away). And since you have OCD about the germs present in the bathroom, ask your mom or you buy it yourself a small container of hand sanitizer that you refill at home and carry in your pocket. Put it on before you go into the bathroom as a barrier and then wash on the way back out. Use a paper towel or carry a paper towel or Kleenex into the bathroom with you to reopen the door to leave the restroom after washing. :>) Problem solve, there ARE solutions. Better than the embarrassment and humiliation of going on yourself.
But the bigger issue, how can you get help for the disorder of OCD? Do your parents know? They are your first line of defense. This is a treatable disorder!! But you have to seek treatment and help to get it. Talk to your parents. Then your gp for a referral to someone that works with teens and anxiety disorders. AND, your school counselor is again a very valuable resource and ally. Let us know how you are doing!