Corbyn and Khan are "negative forces," said Trump.
The Labour leader asked to meet Trump but the US president said he turned him down.
Trump said the NHS would be on the table during talks but later backtracked his comments.
Intelligence sharing with the UK will continue despite Huawei, he said.
He added reports of protests against him were "fake news," saying that he didn't see any demonstrations.
The president said he thought Brexit "will happen and it probably should happen".
US President Donald Trump and British Prime Minister Theresa May are holding a press conference outside Downing Street following talks on a post-Brexit deal between the two nations.
When asked his thoughts on Mayor of London Sadiq Khan, Trump said he did not think he was a "very good mayor" and labelled him a "negative force, not a positive force".
On the leader of the opposition Jeremy Corbyn, who was set to attend protests in the British capital against the president's visit, Trump said he didn't know the Labour chief, but that he too was somewhat of a negative force.
He added that Corbyn wanted to meet him, but "I decided not to do that".
The Labour party put out a statement following the comments with a spokesman saying: "Jeremy Corbyn proposed a meeting with Donald Trump during the president’s visit.
"Jeremy is ready to engage with the president on a range of issues, including the climate emergency, threats to peace and the refugee crisis."
"Dear Mr President, the NHS isn't on the table in trade talks"
On the UK's treasured National Health Service, Trump said that it could be opened up to US competition as part of trade negotiations after Brexit, as "when you're dealing with trade everything is on the table".
"I think we are going to have a great and very comprehensive trade deal," he said.
However, the president backtracked on his comments in an interview broadcasted by ITV News. He said that while nothing would be off the table in talks, he did not see the NHS falling under the realm of trade.
"I don't see it being on the table. Somebody asked me a question today and I say everything is up for negotiation, because everything is," Trump said to ITV News.
"That's something that I would not consider part of trade. That's not trade."
May had suggested earlier the NHS might be off-limits.
"The point about making trade deals, of course, is that both sides negotiate and come to an agreement about what should or should not be in that trade deal for the future," she said at the news conference.
Britain's health minister, Matt Hancock, responded to the president's first comments by saying the NHS would never be on the table for trade talks while he was minister.
"A precious and profound friendship"
She also paid tribute during her speech to "a precious and profound friendship" between the US and UK, while Trump dubbed it "the greatest alliance the world has ever known".
The British PM also addressed the issue of China, saying "we cannot ignore actions that threaten our shared interests and values".
Trump praised the UK leader calling her "a tremendous professional who dearly loves her country," saying it had been an honour to work with her.
You can watch the full news conference back in the above video player.
'A substantial and fair deal'
At a business meeting on Tuesday before the conference, Trump said the US is ready to do a “very substantial and fair deal” with Britain after Brexit.
“I think we'll have a very very substantial trade deal, it'll be a very fair deal, and I think it's something we both want to do," Trump told May at the start of the meeting. “We’re going to get it done.”
May later said she was confident both parties were "committed to an ambitious trade deal" after "positive talks".
Trump thanked the British prime minister and said he didn’t know her timing [of her departure] but that she should “stick around” to get the deal done.
"I don't know exactly what your timing is, but stick around. Let's do this deal," said Trump.
May is due to resign on Friday but will remain on post until they find her replacement.
"We are your largest partner... I think there's a great opportunity to greatly enlarge that, especially now," he said.
'Poster boy for the far-right'
Khan called Trump a "poster boy" for far-right activists all over the world, keeping up a long-term feud with the US president.
"Surely we should be saying 'listen, you know, you do realise you're a poster-boy for the far-right movement around the world," he told Sky News in an interview, talking about Trump's policies on Muslims and immigration centres.
Before stepping off the air force one on Monday, Trump called a Khan a "stone-cold loser" on Twitter.
Boris Johnson will not be meeting Trump
According to ITV's political editor Robert Peston, Boris Johnson has turned down the chance to meet with Trump.
Johnson had a 20-minute phone call with Trump in the morning, said Peston in a tweet, but he declined to meet in person because of scheduled hustings events.
Trump said reiterated his support for both Johnson and British Foreign Secretary Jeremy Hunt, saying they were both strong candidates to become prime minister, when he was asked about the race to succeed Theresa May.
"I know Boris, I like him, I've liked him for a long time. I think he would do a very good job," he told the conference, in front of Hunt.
"I know Jeremy, I think he'd do a very good job. I don't know Michael (Environment Secretary Gove), but would he do a good job? Jeremy, tell me," he said to laughter.