BEE! There's a BEE IN THE CLASSROOM!
Hahah who doesn't remember that one? Classic.
Anyways, No. A school is private property and you must abide by the rules of the faculty or they can legally have you removed. Trust me, I have researched this extensively. My teachers often referred to my class of 09' as, and I quote, "the worst class to have ever gone through this school" Which I think is unfair because 30% of us were never even there, but I digress... Back then e-cigarettes were only of the cig-alike variety and we routinely smoked in the bathroom each lunchwave. We did suggest they allow us to smoke outside the lunchroom exit door but they wouldn't even consider it. So we continued packing the bathroom stalls 3 or 4 to a stall. The paid hall monitor often came in to suspend everyone that came out of a stall with more than 1 person in it, but that stopped when we started packing in non-smoker friends & threatening that we felt uncomfortable with a man standing in the bathrooms all the time. Then the doors of the bathroom were wedged open. But that stopped when the two teachers in the classrooms next to the bathroom started complaining that the smell was disrupting their classes. Then teachers were assigned to stand outside the bathroom doors during the lunch periods, and mysteriously the bathroom window fell out of the frame. Then a very curvy life-size woman doing yoga was scratched into the bathroom wall. After that the doors stayed closed, a window with a crank was installed, and our school got the first hall security cameras out of all the high schools in our town. It made the paper! No one bothered the smokers anymore and we all graduated by the skin of our teeth. It was a magical time.
What I'm trying to say is, your teacher can impose any rules he or she wants to impose.
Just go to the bathroom. You've got it so easy with good e-cigarettes and PVs, they leave no smell.
You could poke your head outside the door if you have to. Or do it in the hall.