Matthew Dunn is a former MI6 front-line special operative and the author of six novels, "Spycatcher," "Sentinel," "Slingshot," "Dark Spies," "The Spy House" and "A Soldier's Revenge." His seventh, "Act of Betrayal," is due for publication by William Morrow in October. The opinions expressed in this commentary are his.

(CNN) I'm a former British Intelligence officer who combated terrorism for six years. Counter-terrorism is a nasty, complex and often frustrating job. It's not for the faint-hearted. Sometimes terrorists slip through the net, but often they are stopped in their tracks by the use of arrests or absolute force.

All of us who've worked on the front lines know that gunning down a terrorist is only one part of the solution. We don't want violence, because the bottom line is that we're fighting violence. We want other solutions.

While the facts about what happened in the terrorist attack in London on Wednesday are still under police investigation, certain details have been officially revealed . Khalid Masood, a British national, drove his car into numerous pedestrians on Westminster Bridge before smashing his vehicle into railings near the Palace of Westminster.

The carnage on the bridge resulted in three deaths and severe injuries to others, including a woman who fell into the River Thames. Masood then sprinted to The Houses of Parliament and knifed to death a fourth person, unarmed police constable Keith Palmer. Masood was shot by security forces.

The dreadful nature of the attack was not unprecedented. But what happened after Masood was gunned down was remarkable.

After the police and other emergency services raced to the crime scene to help the victims, they also tried to resuscitate Masood. Why? Because paramedics believed the terrorist deserved to live.

Ultimately what happened on Wednesday showed how community belief in British values steadfastly pulls people together with remarkable heroism and resolution in times of crises. Members of the public rushed to help injured French children, Britons, Romanians, South Koreans, Greeks, Germans, Polish, Irish, Chinese, Italians and Americans.

Tory Foreign Minister Tobias Ellwood tried to resuscitate PC Palmer by giving him mouth to mouth. We Brits are a multicultural bunch and always have been. We're travellers, adventurers and thinkers. We are also fighters.

Sometimes we do the right thing overseas. Sometimes in our history we've got it wrong. But one thing we've never got wrong is our embracing of foreign nationals moving to our country and the tourists who visit our shores.

JUST WATCHED Neighbors describe London attacker Replay More Videos ... MUST WATCH Neighbors describe London attacker 02:29

It saddens me to see what President Donald Trump is doing to America. The United States doesn't have to be like Great Britain, and vice versa. We have different histories, geographies, politics and social norms.

But we do share democratic principles and a heritage of inclusion of people from all walks of life. Because of this, our countries are allies.

That alliance is under severe strain while Trump is in power. Many Americans and many British nationals won't care about that allegiance, but it should matter. Britain has forged its contemporary identity around not only tolerance but more crucially, compassion for others. Trump represents the antithesis of those values.

Britain will not want to be in partnership with a president that the democratic world despises. No doubt the alliance between the UK and US will continue, but the UK will be looking to shore up other alliances in light of Trump's rhetoric about the world and the immigrants who live in the US.

Over time, through a succession of successes and blunders, Britain has learned the hard way what defines its raison d'être. Now, we have a Mayor of London who happens to be of Muslim faith. He's condemned what happened on Wednesday and is mobilizing all London resources at his disposal to make people safe. The mayor is an elected British national.

Now we have an Archbishop of Canterbury who sits with thoroughly British imams and talks about differences in religious beliefs. They share an unswerving agreement that God exists.

I'm an atheist and I don't buy into the substance of religious beliefs. But I wholeheartedly believe in the dialogue between people of different faiths and backgrounds who recognize each other as friends.

This is an approach that Trump should but almost certainly will not adopt. He is mean-hearted, and a chunk of America seems to like that about him. His supporters applaud his efforts to block nationals from certain Muslim countries from entering the US and to build a wall to keep Mexicans out. Meanwhile he downplays the dangers of far-right nationalistic dictatorships such as Russia.

Yet many Americans, perhaps a majority, are as multicultural and open-minded as many people on my side of the pond. And we have mean-minded, narrow thinkers in the UK, too.

The difference between us and what's happening in the States is we haven't elected manifestly demagogic and incendiary politicians into office. There are too many checks and balances. If a racist politician pops up in Britain, we give him air time within reason and then ridicule him until he goes away.

Trump wants an angry and insular America, to batten down the hatches and become the Alamo. What Trump doesn't understand is that terrorism is never defeated by that kind of mindset. It is defeated by dialogue with those we perceive to be our enemies; by being friends with people not like us; by sharing jokes; by communities embracing differences; by good parenting; by good policing; by education; by sharing food; and by a strong economy to give people a good quality of life.

Grand-scale terrorism is for now being defeated. Lone wolves and low-tech terrorism remain the problem. Driving cars into innocents has become the latest tactic used by terrorists in Europe. So, we are faced with the options of putting up concrete barricades on our London roads to stop traffic and restrict freedom of our civilians or maintaining the vibrant throb of a pulsating city. Britain will go for the latter option, while being sensible with security measures.

But Trump doesn't understand the importance of this approach because he thinks like a sociopath. Terrorism such as we saw in London this past week isn't his fault, but he can be blamed for the path he's taking his country on.

Things are already in motion. The majority of liberal Europe hates Trump. Many women, American or otherwise, hate Trump. Much of the US Republican party hates their figurehead.

Follow CNN Opinion Join us on Twitter and Facebook

America has for decades been described by countries such as Iran as the Great Satan. But diplomacy and other initiatives had softened the Muslim world's view of America. Within weeks, Trump has put America back on the map for certain quarters of the world as enemy number one. Within that dynamic, terrorism is energized.

Jihadists and other terrorists may find it harder to strike America. But they still loathe what Trump represents. In many cases, they're hitting softer targets in Europe -- those with open borders, multiculturalism, and closer proximity to places like the Middle East.

It's not just because France, Germany, Belgium and Britain are democracies; our allegiance to America may also be a factor. Meanwhile, Trump is ranting and standing back while Europe suffers. Post Brexit, we need trade with America. But there is no doubt the UK would be safer if it distanced itself from the United States under Trump.

Should Americans care about what goes on in Europe? Yes. During the London attacks, Kurt Cochran — an American — was killed on British streets.