Only O2 (and not Virgin Media) can do that officially, but if you're not the original customer they may be within their rights to refuse or charge you. I'd try posting on the O2 forum for advice, because the two companies are largely separate at the moment.
You could try the market stall phone fixers, but I can't say whether they'd be able to do it, or for a fair price. There's various fixes touted on the web, obviously you have to be able to trust the service provider if paying, and if doing some DIY fiddle then you have to hope you don't brick it.
If the worst comes to the worst, re-sell on eBay (making it clear it's network locked, that won't matter to some buyers), and buy one that's sold as unlocked.
Thank you for your post and welcome back to our community forums. We're here to help.
As @Andrew-G has advised, if your handset is locked to a third party network then it'd be best to speak with them directly and they can assist you in getting it unlocked. There's more information on O2's website about their policy for unlocking their handsets.
O2 will not unlock it if you are not the original owner - if its ex contract then they will unlock it for free BUT only via the original owner - they need to fill the form in on the O2 site and it should just happen
so go back to the seller and get them to fill the form in - O2 will want some details off the phone
the market stall sellers can unlock them but its not guaranteed and afaik can relock if the OS is updated - add to that the last time i heard it was about £50
HI Celtsof67, thanks for the message and sorry to hear about the issues which you are having with the handset. Can you confirm if you have tried what Tony has suggested? If you are unsuccessful, you may need to return the phone or take our 02 services. ^Chris
Cheers for help everyone , tried to get seller to get it unlocked but he actually fobbed me off with it’s already wrapped up for postage and it wasn’t advertised as unlocked , so after telling him I would be returning it after I received it he just refunded me . Will know better next time so thanks everyone. jas