How to unlock a "network sim" in order to use a Android phone? I got an old Android phone (HTC MyTouch) from someone in the States. The phone says "T-Mobile" on the top.

I put in my O2 SIM chip (Germany), turned it on, typed in the SIM, but then it asks me to type in a "SIM network unlock pin".

I went to T-Mobile here in Germany and they said to "contact T-Mobile in America" who may be able to unlock it for me.

I went to the O2 shop in Germany and they said it would definitely not be possible to use this Android phone with my O2 SIM chip.

Before I sink hours into contacting T-Mobile in the States, can someone tell me from experience if it is (technically and legally) possible to use this Android phone in Germany?
You'll need to purchase an unlock code.

You will probably find a number of companies via google a I have used a couple, which I'm not sure I'm allowed to post here so I recommend you visit Modaco, the site run by Paul O'Brien of custom rom and rooting fame.

Click the Android part of the site and at the bottom of the site or via a web banner to the right, you'll see one of their official sponsors that does HTC codes for $20.