As @weeveeship mentions, extradition is a possibility. However, it’s not always there, as @aprilsimnel. There must be an extradition treaty between the countries as well as one that covers the crime in question. Otherwise, extradition is a matter of discretion.
There is also the shadowy methods of rendition – which is the extrajudicial kidnapping and transfer of a person to another country for trial. That’s illegal in the international sense – but it happens of course.
Many countries, further, will refuse to extradite an individual to a country, even if there is an extradition treaty, if that country would inflict a punishment like the death penalty regardless of the crime. Abolition states refuse to do say because extradition, in essence, is the state acting to put a man to death,
Finally, there are classes of crimes that may be considered political, and therefore may result in a country acting essentially as an asylum nation for individuals within their borders. Certain violent crimes may have been done in the name of freedom from government tyranny (e.g., the difference between a terrorist and a freedom fighter), and the courts will often refuse to extradite for fear of supporting a governments persecution of its citizens.