WELL... like many things, it depends.
In public, for most girls, it's pretty damned disrespectful. Just as initiating a makeout session on a public street in front of an elementary school is pretty tasteless and shows you have no concern for the future youth. Slapping their ass in a crowded high school hallway is pretty much a no-no.
Girls don't like to be considered slutty, it's in their nature. Even if they like being treated like it, social programming has sent it against them. So when you display something like that in a public place, where others can see, it can just be downright mean and offensive.
Now, if it's kinda in the back of the class and no one sees and you and the girl are pretty well off, I don't think a good job pat is that bad at all. When I'm with my girlfriend, I'll even grab it as a "hurry up," "good luck," "good job," "quit teasing me or I'll strip you down right here," kind of gesture.
But still, as with all things of this nature, it depends on who it's to, what your relationship is with that person, how deep in that relationship you are in with that person, where it is, and how you think they'll react. But if you do start though, don't back away if she just gets playfully offended. Make sure you play it off like it's a normal thing to do, otherwise it'll seem like you were just testing the waters or wanting a little grabby grabby.
Maybe I'm just talking too much from personal experience.
Last note. I wouldn't grab her in the workplace, I wouldn't grab her if I were still going to school, I wouldn't grab her in a place where people who she knows can easily see. How do you know her mom isn't just 15 yards away talking to a teacher?
You don't.