PHILADELPHIA — President Trump’s decision to build a wall along the length of the United States’ southern border with Mexico erupted into a diplomatic standoff on Thursday, leading to the cancellation of a White House visit by Mexico’s president and sharply rising tensions over who would pay for the wall.

With the conflict escalating, Mr. Trump appeared to embrace a proposal by House Republicans that would impose a 20 percent tax on all imported goods. The White House press secretary, Sean Spicer, told reporters that the proceeds would be used to pay for the border wall, estimated to cost as much as $20 billion.

But a furious uproar prompted Mr. Spicer to temper his earlier remarks, saying the plan was simply “one idea” that might work to finance the wall. Mr. Spicer said it was not the job of the White House to “roll something out” on tax policy, while Mr. Trump’s chief of staff, Reince Priebus, said the administration was considering “a buffet of options.”

If Mr. Trump does eventually announce his support for the tax plan, it could have a broad impact on the American economy, and its consumers and workers, by sharply increasing the prices of imported goods or reducing profits for the companies that produce them. Other nations could retaliate, prompting a trade war that could hit consumers around the globe.