No one has immunity before the court; what counts is whether someone is alleged to have committed crimes. Once before the court, the person certainly does not have immunity, although states are never obliged to violate their own obligations under international law by surrendering someone to the court. It is a system that provides for respect for international law before the person is before the court.
In the case of a state that is not a state party, the only way of bringing a person to justice is through a Security Council referral; there is no other way.