If you have an O2 sim you can get the phone unlocked for free if you're a Pay Monthly customer, or you would have to put £15 on a Pay & Go sim to unlock it. Take a look at this help thread written by @MI5
Sim should work fine and the phone should pick up the settings automatically.
I have no affiliation whatsoever with O2 or any subsidiary companies. Comments posted are entirely of my own opinion. This is not Customer Service so we are unable to help with account specific issues.