Many of the european services have regs that allow beards as well as longer hair than we are accustomed to, especially amongst naval services where beards are almost a tradition. I remember in the 1960's seeing hair nets on soldiers in european army units designed to keep their long locks out of the machinery. A buddy of mine, an A-3 BN, told me that his ship, the America, rendezvoused with a New Zealand tanker to take on fuel in the Pacific and he got a big kick out of watching the RNZ officers on the tanker's bridge sporting beards, big sweaters and shorts along with their bridge covers.
There was a short window in the US Navy back around 1971 or so when then-CNO Adm Elmo Zumwalt put out a mandate that allowed beards for US officers (assuming they didn't interfere with oxygen masks- Royal Navy pilots had been wearing beards, however, with O2 masks for years). Zumwalt's missives at the time were known as "Z Grams." The move was not welcomed further down the chain but, basically, there was nothing they could do if a JO wanted to grow a beard except give him a rough time.