LONDON — President Trump put his brand of confrontational and disruptive diplomacy on full display Thursday, unsettling NATO allies with a blustering performance in Brussels and then, in a remarkable breach of protocol, publicly undercutting Prime Minister Theresa May of Britain in an interview published hours after landing in her country.

In the interview with The Sun, Mr. Trump second-guessed Mrs. May’s handling of the main issue on her plate: how Britain should cut ties to the European Union. He cast doubt on whether he was willing to negotiate a new trade deal between Britain and the United States, and praised Mrs. May’s Conservative Party rival, Boris Johnson, as a potentially great prime minister.

The interview was published as Mr. Trump and Mrs. May were wrapping up what appeared to be a chummy dinner at Blenheim Palace — earlier, they had walked inside holding hands — and a day ahead of the president’s scheduled meeting with Queen Elizabeth II at Windsor Castle. There was no immediate response from the British government.

“Well, I think the deal that she is striking is not what the people voted on,” Mr. Trump said in the interview, speaking of the approach Mrs. May is taking to Britain’s exit from the European Union, or Brexit, under which the British economy would effectively continue to be subject to many European regulations.