From 10 November, the iPhone can be unlocked for O2 customers in the UK.
Pay Monthly customers
Your iPhone can be unlocked at anytime free of charge. If you unlock your handset and place a non-O2 sim into it, you will still have to honour the remainder of the minimum term on your contract.
iPhone Pay & Go customers
For iPhone on Pay & Go, unlocking can take place 12 months after you've bought your iPhone for a one-off £14.69 fee which will be deducted from your airtime balance.
Just goto this link http://shop.o2.co.uk/update/unlockmyiphone.html