Modern military masks have a mechanism that forces the mask onto the face. There would be less leakage with a beard than with a standard airline mask.
A lot of the military masks are pressure masks and a lot (if not all) of the airliner ones are on-demand type so sealing just isn't as important for them.