Crowning a year of disputes with the Trump administration over trade tariffs, support for Ukraine and the future of Greenland, the Iran war has placed America’s friends in Europe, Asia and the Middle East in front of an uneasy dilemma.

Their most important ally is acting in ways that they see as erratic and that have already caused hardship and uncertainty. The war has sapped their economies and even bigger shocks loom if the Strait of Hormuz remains closed, deepening the worldwide energy crisis.

Many—on both sides of the Atlantic—wonder if they are even allies anymore. Angered by the refusal of European nations to join the war alongside the U.S. and Israel, President Trump has called European countries cowards, and threatened to withdraw from the North Atlantic Treaty Organization altogether.

“The United States is unpredictable,” said Roderich Kiesewetter , a lawmaker from Germany’s ruling party, echoing a widespread sentiment in Europe. “It’s not a reliable partner anymore for the Western world.”

NEWSLETTER TABLE TALK

Never miss a story.
Subscribe now.

The most important news & topics every week in your inbox.

Their quandary is that nobody else can substitute for America’s military and economic might in the foreseeable future. China and Russia also carry out predatory policies. It will take time for middle-sized democracies in Europe and Asia to wean themselves from dependencies on America and to intensify cooperation among themselves.

Ever since World War II, the U.S. was mostly a benevolent power for its fellow democracies and achieved its hegemony by consent, said Michael Fullilove , executive director of the Lowy Institute, an Australian think tank. That’s not how Trump’s America is viewed today.

“If you insult your allies and push them to the brink in every negotiation, if you present your ugliest face to the world, then this consent will evaporate,” Fullilove said. “But what is the alternative to the U.S.-led alliance system? The U.S. is the only country that can project power anywhere on Earth. Who else will lead the West, if not Washington?”

This Catch-22 is acutely felt by U.S. partners and allies in the Persian Gulf. With their cities subjected to daily Iranian missile and drone barrages, the Gulf states are most affected by the Iranian retaliation for a war that they didn’t start and whose course they cannot control.

Gulf officials have grown frustrated with Trump—who, among other undiplomatic moves, publicly insulted Saudi Arabia’s Crown Prince Mohammed bin Salman by saying last month, at a Saudi-sponsored investment conference, that the kingdom’s de-facto ruler “didn’t think he’d be kissing my ass.”

Yet, these Gulf states also know that only Washington can provide them with crucial weapons, particularly air defenses, and offer protection from future Iranian attempts to dominate the region.

“Our main security partner is the United States,” Anwar Gargash , diplomatic adviser to the United Arab Emirates president, told a group of reporters Saturday. “We’ll double down on our relationship with the United States.”

A similar calculation is in play in Asia. South Korea, facing a threat from North Korea and an emboldened China, watched with dismay as the U.S. redeployed vital air-defense resources to the Middle East last month.

“The action that the U.S. is engaged in in Iran not only reveals the U.S. as a rogue actor whose political values at home and internationally are no longer in accordance with South Korea’s professed values, but also one whose actions will have huge economic consequences,” said Mason Richey, a professor of international politics at Hankuk University of Foreign Studies in Seoul. “Yet, South Korea also needs to stay on the right side of the Trump administration for its own security purposes.”

Secretary of State Marco Rubio said that European and Asian allies, unlike the U.S., depend on energy flows through the Strait of Hormuz and should be the ones to step up and deal with the problem. He added that the U.S. will examine after the Iran war whether the NATO alliance has become “a one-way street” where America defends Europe, but is denied the use of its bases and overflight rights by some European states.

At Monday’s news conference, Trump touted his good relationship with North Korea’s leader as he complained about South Korea’s refusal to join the war on Iran, and said that he still wants Greenland.

Few in European or Asian democracies root for the Iranian regime, a theocracy that massacred thousands of its own citizens as it crushed pro-democracy protests in January. But, as America’s military difficulties mounted in recent weeks, a certain amount of schadenfreude gained steam—a hope that setbacks in the war would curb Trump’s appetite for interventions elsewhere, and herald a return to a more conventional way of conducting international relations.

“People admire the Wild West cowboy approach to geopolitics only when it is successful,” said Australia’s former Prime Minister Malcolm Turnbull, a center-right politician who overlapped in office with Trump’s first presidency. “America’s friends are not just hoping for an early end to this war of choice. They also hope that America’s fever breaks, that wild impulsive strategic moves are replaced by a more orderly approach to geopolitics.”

Trump’s constant zigzagging on key policy issues, brusque decisions to scrap previous agreements, and general disregard for the views of allies means that even those foreign leaders who have tried to court him—such as Italian Prime Minister Giorgia Meloni—have often been burned by the experience.

“Everyone is confused. Nobody can understand what America actually is today. It seems governed by some kind of mad emperor who keeps saying whatever comes to his mind, something we haven’t witnessed since Caligula or Nero,” said Carlo Calenda, an Italian senator and former economic development minister. “The one thing the Europeans have understood is that we are dealing with a bully. You can give him everything he wants, you can pretend you don’t hear his insults, but he will keep trying to bully us, and so at a certain point we must stop him.”

The January crisis over Trump’s attempt to seize the Danish possession of Greenland , when it seemed for a few days that the U.S. might launch a military operation against its European allies, became a key turning point for European leaders.

“This will never be forgotten,” said retired French Lt. Gen. Michel Yakovleff. “Psychologically, Trump talking about taking Greenland was the equivalent of a father talking, jokingly, of raping one of his daughters. Obviously, it’s a new world in the family after that.”

Outrage at Trump’s America is evident from opinion polling. Some 34% in Europe’s biggest nations view the U.S. as a threat, a figure comparable or even higher than the perceived threat from China, North Korea or Iran, according to a YouGov poll released in February, before the war began. Only Russia is considered a bigger danger. Such attitudes explain why no traditional ally in Europe or Asia yielded to Trump’s demands to join the military campaign, and to deploy forces to reopen the vital Strait of Hormuz to free navigation.

In fact, the current war is the first major conflict in a century that the U.S. is waging without any of its traditional allies. Almost every NATO member showed up in Afghanistan. Countries like the United Kingdom and Spain joined the 2003 invasion of Iraq. Dozens of nations participated in the 1991 Gulf War against Iraq. Even in Vietnam, American troops were helped by Australia, South Korea, New Zealand, the Philippines and Thailand.

These days, even many of the far-right and populist movements courted by MAGA have condemned the Iran war and tried to distance themselves from Trump. Jordan Bardella, the leader of France’s Rassemblement National who is leading the polls for the first round of next year’s presidential election, recently blasted U.S. goals in Iran as “extremely erratic” and praised President Emmanuel Macron’s refusal to join the war as “reasonable and honorable.”

Tino Chrupalla, the co-chair of Alternative for Germany, went even further. He called on Berlin to follow the example of Spain’s left-wing government and ban the U.S. from using military bases in Germany in the “war of aggression” against the Islamic Republic. He also suggested that all American troops be removed from the country.

“The MAGA strategy of building a united hard-right international in Europe appears to be a collateral damage of Trump’s strikes on Iran,” said Constanze Stelzenmüller, director of the Center on the United States and Europe at the Brookings Institution.

Write to Yaroslav Trofimov at yaroslav.trofimov@wsj.com