In the UK a couple of government ministers (Westminster) and the First Minister of Scotland can invoke the royal prerogative of mercy in order to effectively pardon someone for their crimes and get them released from prison. However, I understand that it is very rarely used.