Of course that Europe has different laws, but in the case of my relative, his father started the deal by giving an expensive gold pen as a gift from his wife to the judge. When it came his son's case turn, the judge listened the case and gave him the choice between jail and the army. The son didn't say anything but his father chose the army for many reasons and the main one was to avoid criminal records for his son.
I have no idea if the army is capable to investigate every similar case in US and around the world, but I agree with 10 that such indeed happens, and if 10 was joking then I am not because I saw my brother in law servicing in the navy of his country right after his case in court. His service in the navy lasted two years, and he has no criminal records as far as I know.