LONDON — In a wide-ranging interview on President Trump said there was “a chance” of military action against Iran, cast his ban on transgender people serving in the military as an economic decision and admitted using the word “nasty” in connection with Meghan, Duchess of Sussex. He made the remarks on ITV’s “Good Morning Britain” to Piers Morgan, the show’s co-host who was the winner of “The Celebrity Apprentice” in the United States in 2007-8 and someone Mr. Trump considers a friend. Mr. Trump’s state visit has been a whirlwind of ceremonial events with the royal family, including a state banquet on Monday; tea with Prince Charles and his wife, Camilla, Duchess of Cornwall; and political and business meetings on Tuesday with Mrs. May and other top officials in which he urged Britain to forge ahead with plans to quit the European Union, dangling the prospect of a “phenomenal” trade deal with the United States. But his trip has been marked by a continuing feud with the mayor of London, Sadiq Khan, and protests that brought thousands of people to the streets of London with new and old props, including the Trump baby balloon and one called Dump Trump, which shows the president sitting on a golden commode. Mr. Trump, who is often unsettled by reports of protests, sought to play down the demonstrations, calling them “fake news” in a news conference with Mrs. May on Tuesday and tweeting on Wednesday morning that there were actually “big crowds” supporting him. Mr. Trump had set the stage for his second trip to Britain as president with interviews in The Sun and The Sunday Times, both Rupert Murdoch-owned newspapers. Asked by The Sun’s reporter about criticisms that the former Meghan Markle, Prince Harry’s wife, made about him in 2016, Mr. Trump replied, “I didn’t know she was nasty.” He later denied saying the word nasty, even though the exchange had been recorded. Mr. Trump acknowledged to Mr. Morgan: “They said some of the things that she said and, it’s actually on tape. And I said, ‘Well, I didn’t know she was nasty.’ I wasn’t referring to she’s nasty. I said she was nasty about me. And, essentially, I didn’t know she was nasty about me.” When Mr. Morgan told him that his “nasty” comment could be read different ways, he insisted: “She was nasty to me. And that’s O.K. for her to be nasty. It’s not good for me to be nasty to her, and I wasn’t.” The president said he had had a warm exchange with the duchess’s husband, Prince Harry. “In fact, he spent a lot of time talking to Ivanka and talking to my family. I went up — he couldn’t have been nicer,” Mr. Trump said.