LONDON — Britain was still counting the final votes in its landmark election early Friday morning when Democrats and Republicans on the other side of the Atlantic began asking what Prime Minister Boris Johnson’s landslide victory meant for them: Was it a good omen for President Trump’s re-election chances in 2020, a cautionary tale for Democrats, or both?

It had happened before, in June 2016: Britain’s angry vote to leave the European Union was seen as a canary-in-the-coal-mine for Mr. Trump’s insurgent victory over Hillary Clinton five months later. On Friday in the Oval Office, Mr. Trump latched on to the idea that history might repeat itself.

“I think that might be a harbinger of what’s to come in our country,” he said of Mr. Johnson’s big win.

But if there are parallels, there are also important differences between this British election and the American one next year.