Donald Trump and Bernie Sanders don’t think much of each other. One is a billionaire capitalist builder, the other a democratic socialist who rails against billionaires. Each believes that the other would be a disaster for the country as president. But there is more to their story than that.

The two outsiders have rattled the political establishment. Each has created a movement of passionate supporters who want them to upend the political status quo. And for two men who seemingly couldn’t be more different, their views have sometimes converged in surprising ways — no doubt more than they’d want to admit.

Start with some aspects of their campaigns. Both like to talk about polls.

No poll seems to escape Trump’s attention — good polls, bad polls, scientific polls, unscientific polls. He cites them for proof of his popularity and mercilessly to put down his opponents.

Here’s how Sanders started his opening statement at Thursday’s rowdy debate with Hillary Clinton in Brooklyn: “When we began this campaign almost a year ago, we started off at 3 percent in the polls. We were about 70 points behind Secretary Clinton. In the last couple of weeks, there were two polls out there that had us ahead.”

Republican presidential candidate Donald Trump complained about the delegate voting process at his Rochester, N.Y., rally on April 10, saying, "We're supposed to be a democracy." (Reuters)

Both denounce super PACs and neither has to spend time asking wealthy people for money, as Clinton must do constantly. Trump is largely self-funding his own campaign, although he does get contributions from individual supporters. Sanders has a grass-roots money machine that has produced a record number of individual contributions, which he says average $27.

Both have grievances about party rules. Trump says the delegate selection process, particularly in states such as Colorado, where voters didn’t cast ballots, is fundamentally unfair — rigged against him. Sanders has a beef about the potential role of superdelegates, those party leaders and elected officials who have automatic slots at the convention and a big majority of whom already are pledged to Clinton.

[Trump’s fight with GOP hierarchy escalates.]

The rules cut both ways, of course. Both Trump and Sanders have been beneficiaries of the quirks of the their party’s regulations. Trump won only about one-third of the popular vote in the South Carolina primary but got all 50 delegates. Meanwhile, Sanders would be much further behind in pledged delegates if Democrats allowed winner-take-all primaries, as Clinton has captured more of the big-state primaries.

Both Trump and Sanders feel under attack — probably for good reason.

Trump believes the national party leadership wants to deny him the nomination, and there’s good evidence of that. Sanders not only sees the party hierarchy favoring Clinton — although Democratic National Committee officials swear they have maintained their neutrality — but also points to corporate leaders as his enemies.

On some policy issues, Sanders and Trump also agree. The most obvious is trade, where they share almost identical positions.

1 of 42 Full Screen Autoplay Close Skip Ad × Highlights from Bernie Sanders’s campaign, in pictures View Photos The senator from Vermont has become Hillary Clinton’s chief rival in the contest for the Democratic presidential nomination. Caption The senator from Vermont is Hillary Clinton’s rival in the contest for the Democratic presidential nomination. June 14, 2016 Bernie Sanders arrives at the Capital Hilton to meet with Hillary Clinton in D.C. Matt McClain/The Washington Post Buy Photo Wait 1 second to continue.

From the start of his campaign Trump has railed against what he says are horrendously bad trade deals that have hurt the country, setting himself at odds with mainstream Republican policy. Many more Democrats agree with Sanders’s opposition to trade agreements. He’s not really out of the mainstream. But his position runs counter to the policies of President Obama and former president Bill Clinton, and he has pushed Hillary Clinton to the left on this during the campaign.

Iraq is another issue on which they have agreed. Sanders has made his opposition to the war and Clinton’s vote for the 2002 congressional measuring authorizing it a central line of demarcation in his campaign — a test of presidential judgment. Trump has gone rogue with the GOP, not only by declaring that the decision to invade was a costly mistake, but also by arguing during a debate earlier this year that President George W. Bush lied about the existence of weapons of mass destruction in Iraq to justify the 2003 invasion.

Thursday’s Democratic Party debate highlighted two other policy issues where Sanders and Trump sound alike: the U.S. role in the North Atlantic Treaty Organization and this country’s posture with regard to Israel and Palestinians.

[Sanders, Clinton stage acrimonious debate in Brooklyn]

Trump made headlines recently when he spoke to The Washington Post editorial board and questioned whether NATO had become obsolete. He argued that European nations should carry a bigger share of the financial burden. “I do think it’s a different world today, and I don’t think we should be nation-building anymore,” he said. “I think it’s proven not to work, and we have a different country than we did then.”

That’s not a lot different from the position Sanders enunciated many years ago. At Thursday’s debate, CNN’s Dana Bash confronted Sanders with a 1997 quotation in which he said, “It is not the time to continue wasting tens of billions of dollars helping to defend Europe, let alone assuming more than our share of any cost associated with expanding NATO.”

Bash asked Sanders how he differed from Trump. “You got to ask Trump,” he replied. Noting problems of poverty and crumbling inner cities, he also sounded like a candidate who thinks nation-building should start at home.

“I would not be embarrassed as president of the United States to say to our European allies, ‘You know what, the United States of America cannot just support your economies,’ ” he said. “You got to put up your own fair share of the defense burden. Nothing wrong with that.”

Trump raised a ruckus in February when he told MSNBC’s Mika Brzezinski and Joe Scarborough that he would be even­handed — “a neutral guy” — when it came to negotiations between Israel and Palestinians.

He was denounced by his rivals and tried to make amends by backpedaling when he spoke to the American Israel Public Affairs Committee (AIPAC ). He has said since that nobody is more pro-Israel than he, but his initial comments continue to raise questions about his true feelings.

On Thursday night, Sanders called himself “100 percent pro-Israel,” but he also criticized Clinton for not speaking about the plight of Palestinians when she recently addressed AIPAC, and he laid out a view that sounded quite similar to Trump’s earlier comments.

“Of course Israel has a right to defend itself,” Sanders said. “But long term there will never be peace in that region unless the United States plays a role, an even­handed role, trying to bring people together and recognizing the serious problems that exist among the Palestinian people.”

There are obviously profound differences between Trump and Sanders. The senator has called Trump “a pathological liar” and has denounced Trump’s comments about immigration, abortion and other issues. Trump sees Sanders as a wild-eyed leftist who would raise taxes or spend the country into bankruptcy or both. That makes the areas in which they seem to be in agreement one more oddity of this surprising campaign season.