A Moff is a regional governor rather than a Military rank. When Tarkin said in A New Hope that "The Regional Governors now have direct control over their territories." These were the Moffs.
A Grand Moff held control over Priority Sectors, those that the Emperor had a special interest in.
A real world comparison may be closer to the relationship of a country leader and their army.
Sources: Moff, Grand Moff.
In the first drafts of Star Wars, the term was "Mouff", but neither that word or Moff appears to have any real world meaning.
There are a couple of references to "Moff" on Fine Dictionary, (but none for Mouff) where it appears to be a fine silk fabric. Or a scientific term I don't understand:
Further, for the given oracle O , the O-ofﬂine oracle complexity of
the given ofﬂine optimization problem is deﬁned as moff (, Z , O) =
inf AO moff (, AO , Z ).
(I think there is another character in those brackets my browser won't render)