Sleeping at work or during classes is so common in Japan that there is actually a word for it in Japanese—「居眠り」( Inemuri).
In order to appropriately appreciate Japanese culture, you must to look at Japanese notions about sleep. In Japan, people are valued for giving their finest, which essentially means that they drive themselves to exhaustion to express that they work hard. Thus, displaying how tired one is is a proclamation in itself— it says you are a hard worker (at least that is what we want to believe haha).
Once people say farewell to their classmates, professors and coworkers in the evening (or morning if they work early) they do not say “have a nice night” or “have a nice weekend.” Rather so, they say 「お疲れ様でした」(otsukaresama deshita), or just「 お疲れ」(otsukare) to close friends only. What does this funky term mean? This term may be most literally translated as “you are tired sir/ma’am”. It is the politest thing you can say to someone after they have worked on or completed something—that they are tired. This may come off as rude or a shock to many foreigners or people learning the language who discover the literal meaning.
The non-literal translation though is a tad friendlier to a foreigner’s ears though haha, and it would be roughly translated to something along the lines of “Thank you for the hard work” or “Good work today.” A lot nicer it seems, no? 🙂
In this context, it is easy to comprehend, to an extent at least, just as to why people are able to usually get away with snoozing at school or work. Classmates, professors and colleagues assume the slumbering person must be working too hard.
There are rules of sleeping at work/居眠り:
1. You need to sit up and appear to be engaged, regardless of the fact that you are clearly asleep. It has to give the impression that you may wake up at any instant and do something remarkable, which means that heads on desk drooling is a no-no.
2. It is far easier to get away with if you are the boss or someone higher up in a team/department or upperclassman. Sleeping at school or work is a symbol of confidence and poise. Many juniors may also get away with it for the reason that no one notices them usually, or rather so, no one cares about them haha.
3. Don’t sleep however during an important [staff] meeting (unless you are high up in the food chain) or a one-on-one with your superiors for then you are considered to being disrespectful by seeing yourself above your seniors, and in such a hierarchical society as Japan that is a social suicide mate.