Diplomatic immunity, technically felon trump isn't stepping into the country, there is a bubble of "USA" around him.
Physically he is there, but whatever country's jurisdiction doesn't apply to him. Or any diplomat for that matter. 😓
Edit: To clarify, it doesn't mean he has the right to enter any country. A country can still declare a person "persona non grata" and ban people from entering including head of states, although I doubt any country is gonna deny the leader of the most powerful country (in terms of military strength) from a official visit because his convicted felon status.
Diplomatic immunity is just gonna be the excuse a country uses to bypass any law in a country that may prevent a foreigner from entering.
That's not how diplomatic immunity works. A nation is welcome to ban entry to any foreign national.
Diplomatic immunity is for crimes commited within a foreign nation. It's also worth notting that the immunity can be revoked as well by the nation that said foreign national is from, there by allowing them to be arrested and tried under the local justice system.