Hungary said on Thursday that it would pull out of the International Criminal Court, announcing its decision just hours after Prime Minister Benjamin Netanyahu of Israel arrived there for a visit despite facing an international arrest warrant.