That's a good point Andrew. I had to search for the answer. Normally the ICC can only prosecute someone from a country that is a member of the ICC, or if the crime occurs in a country that's a member of the ICC. However, if the UN Security Council refers a matter to the ICC that occurred in a non-member state, the ICC may investigate and prosecute. I suspect that's what happened in the case of Sudan's president.

Needless to say, the permanent members of the UNSC will veto the investigation of any person or event that they don't want investigated.