First, the Taliban ‘offer’ was so full of caveats as to be worthless and, most importantly, they refused to do anything about the rest of the Al-Qaeda organisation that they hosted and shared power with and which attacked the US. Putting Bin Laden on trial in some supposed neutral third country would’ve done nothing to remove the clear and present threat to the US that Al-Qaeda at the time presented. So, yes, the US’s actions were legal under international law.
None of the major powers outside Europe have acceded to the ICC. Neither the US, nor India, nor China, nor Russia.