Yes, but only because the US and Germany have an extradition treaty[0]. And even then, I assume the US government could still refuse to extradite for various reasons.
The US has no such treaty with Afghanistan, and is not a party to the ICC.
Whether or not the US should cooperate with the ICC is another matter, but the US has no legal or diplomatic obligation to do so. And in fact the US executive branch is required by US law to actively thwart ICC action against US servicemembers[1].
[0] https://en.wikipedia.org/wiki/List_of_United_States_extradit...
[1] https://en.wikipedia.org/wiki/United_States_and_the_Internat...