A real-life hydrogen maser does have a RF cavity, but the goodness of the cavity is not essential, as explained below.
For laser/maser, you need to amplify and maintain high phase coherence. The longer the storage time, the narrower the frequency resolution (small frequency uncertainty). If the coherence is stored in light, you need a high-finesse cavity with stable length around your active medium. However, if you can store coherence somewhere else, then the quality of cavity is not important. In the case of hydrogen maser, the coherence is stored in the hydrogen atom. The atoms can collide with walls but usually walls are coated with paraffin or Teflon such that they do not lose their coherence. If the atom is viewed as an oscillator, then its linewidth is much narrower than the RF cavity surrounding it. There is a research effort to adopt this "bad-cavity" approach to optical regime (see "Superradiant laser")