The principle of territorial jurisdiction is the oldest and most basic principle of international law in the exercise of national jurisdiction.
Unless it involves diplomatic disputes, violations in that country will be handled in that country. This is how the extradition regulations come to be. Current cybercrime is defined according to the country of the victim, even if the offender and the victim are not in the same country. However, it depends on the strength of the country. Weak countries have no diplomacy.
Does the country have the right to execute the death penalty if the crime is serious?
It is theoretically possible. Jurisprudence is absolutely possible. But it depends on the specific event. Of course, the comparison of the strengths of the two countries is also among them, and the severity of the crime is also considered. The relationship between the two countries and the foreign policies of both countries. Other special groups have diplomatic immunity, such as diplomats.
It is not illegal to kill diplomats?
Diplomats represent a country, and crimes are tried by its country. Of course, other countries can exert pressure. Anyone who kills people illegally, whether intentionally or unintentionally.