Annoyance in animals When my dog (an English Cocker Spaniel, for what its worth) is behind some glass (e.g. a glass door or a car window) and someone taps on the glass, even just a little bit, she gets into a fit of rage. She has always been treated quite well, so I can't imagine what causes her to behave like this.

The first thing that came to my mind is that she perceives whoever is tapping the glass as teasing her, and she feels disrespected, or something like that. This sounds far fetched, but could there be any merit to this theory? If not, what else would cause her to do this?

I believe we know that monkeys interpret teasing correctly (I don't know this for a fact). That is, they know when they are being teased and they (correctly) interpret it as being disrespected. Could the same thing be true for less intelligent animals like dogs?
Teasing generally seems to have two components. First, as mentioned in the title of your question, it is a matter of becoming annoyed; specifically at behavior that is (often repetitively) enacted towards oneself. Furthermore, to know that someone is teasing you it is necessary to be able to conceptualize their intentions (otherwise known as having a "theory of mind"), which is necessary in order to potentially feel disrespected. It is uncontroversial that dogs can feel annoyed, just try relieving one of its food (or tapping on the glass it is behind ;). However, the extent to which dogs are able to conceive of the mental states of others is debated in animal psychology. It has been shown, for instance, that certain populations of dogs are unable to spontaneously adapt to human social cues. However, naturally, many pet domestic dogs are great at adapting to their owners behaviors. Dogs are not "man's best friend" for no reason - they do possess the ability to learn social cues. However, it seems that this has to be taught, whereas it seems that humans have a much greater innate predisposition to TOM/mentalizing. In conclusion, dogs' TOM seems to be a significantly more superficial ability than it is in humans. This leads me to suggest that tapping on the glass causes your Cocker Spaniel to either a) want to play oh-so-badly, or b) get (really) annoyed. They surely don't understand teasing with the full social capacity of a human.