Unless the licensing authority include a specific provision in the premises licence, requiring that staff should not drink behind the bar, it's perfectly lawful to do so. (I've never heard of such a provision being imposed).
Of course, many employers have their own rules which prohibit staff from drinking behind the bar but those rules are completely separate to statute law.
I am a bartender and alot of customers want to buy you a drink if your boss lets you drink them then do so. My boss and owner tells me I should always please the customers just dont get drunk.DO HALF A SHOT INSTEAD OF A WHOLE ONE !!