SIM unlocking, whether by flashing of a chip inside the phone or the entering of a code, is a perfectly legal practice in the United Kingdom and does not void any warranties. If a network argued that because it was unlocked that they are not responsible, then they are essentially liable to prosecution and investigation by Oftel.
Moneysavingexpert would disagree
Warranties can be voided by the failure to adhere to terms agreed to at the time the contract was made. This does not, however affect statutory rights.
But what about my warranty?
While it's not illegal, unlocking your phone WILL invalidate its warranty in most cases.