
If you own a Nokia phone you should be able to unlock it online for free with the
Nokia Online Calculator. You can obtain your IMEI number by entering *#06# into the phone. Then enter the Network that the phone is locked to (not the one you wish to use). Make sure you don't forget to remove the SIM card before you enter the generated code!
I am not a lawyer, though I've heard that it's not illegal to unlock a phone, even if the operators might like you to think it is. Only be careful when entering the unlock sequence. As far as I know you got 5 attempts to unlock by code; after that you would have to call your network provider to unlock the phone for you.
Note that a few of the newer Nokia models are not supported, inluding the 6630, 6680, 7710, 9500, 9300 and 6620.