This is a good question!

There are two sources of demand for a currency: consumption demand - you want to buy American-made goods -- and investment demand - you want to buy American capital.

In terms of consumption demand, as long as the US produces large quantities of goods for sale that the rest of the world wants, there will be this demand for dollars.

Similarly, as long as the US is a safe haven for other countries to store their wealth, knowing that we will not confiscate their investment and maintain the purchasing power of the dollar over time, there will be this investment demand. When people talk about the dollar being a "reserve currency", what they refer to is this investment demand. It's good to invest in the US because your money will be safe here. Many focus on, say, oil being priced in dollars, but what matters more is where you store the proceeds of your sale, and that's a decision based on where you think your money will be safe to store over the long term.

Therefore operationally, the US military has nothing to do with the desirability of the dollar -- except to undermine it with excess military spending :)

However one observes that the U.S. tends to fight a major war every 25 years or so, and invades/bombs a country every year or two, and all of this is done to promote US interests, of which we assume that economic interests play an important role. Those who try to interpret US geopolitical strategy in terms of serving business interests assume that we will use our military to ensure a steady supply of cheap raw materials and open markets for our goods, and therefore this indirectly supports the consumption demand for the dollar.

To a lesser degree, having a large army protect the country tells investors that the factory they buy wont be bombed or taken over by a rival power, which supports the investment demand as well.

In this way, the US military is said to support the dollar.

However I am skeptical of this interpretation of US geopolitical behavior. It may have been the case in the 1900s, and to a lesser degree in the 1980s, but I don't think it's the case today. Today, the US military - on balance - is a drag on the dollar. Getting into a detailed debate about this would require taking a long inventory of US interventions over the last few decades, which is over 100 interventions -- and then decide whether they promoted the investment and consumption demands, on net.

But just to sketch an idea of the argument, now we have sanctions against Venezuela, Iran, and Russia, which are a good chunk of the world's oil supply. Far from using our military to ensure a steady supply of raw materials, we are actually cutting ourselves off from raw materials. Moreover the purpose of sanctions is to prevent selling our goods in other countries. Therefore clearly the purpose of the sanctions policy is not to support the consumption demand for dollars, either via protecting inputs, nor via keeping markets open.

Finally, we are busy gearing up for a conflict with China, which again would not be good for the business community.

Really US geopolitics is difficult to understand at the moment - whatever goals or grand strategy we have, it's no longer the case that safeguarding the dollar is one of these goals. I believe that, during the cold war, this was a goal, because fighting communism could be justified as keeping markets open to the US. But since the 1990s, things began to change.

Honestly I don't even understand why we are still bombing Yemen(*) or still have troops in Syria, or what the point of occupying Afghanistan was. Maybe making defense contractors richer, but that doesn't support either the consumption or investment demand for the dollar.

Therefore although our military is a powerful tool, it's not the case that we are still using this tool to support the dollar.

Long term, this is bad news for the dollar.

- - -

(*) Technically, Saudi Arabia is bombing Yemen with US planes and US ammunition. However, we also send US pilots in the planes to "advise" the Saudi pilots, and they often do the bombing. There is a lot of sheep-dipping going on as well here and in other proxy wars.