Hi, I'll be happy to help with this issue
the dongle is probably locked to O2, however they may provide the unlock code for it depending on how old it is
do you know the make/model of the dongle?
you can check the status of the dongle using this client
Mine is a "Huawei E1752Cu USB Modem"
you should be able to unlock it following these steps which have previously worked on that O2 model
1. Write down the IMEI number on a bit of paper (it's the 15 digit number on the back of the dongle).2. Remove the O2 sim card and then inserted the sim card of another mobile phone network, then plug the dongle back in. After a while a box popped up in the Mobile Partner software asking for the unlock code.3. Run the software from here http://wikisend.com/download/150564/Huawei Unlocker.zip4. When the software starts, type in the IMEI number and then click the button5. In the text which appears, look for NCK: - the number directly after NCK: is the unlock code6. I typed in the unlock code into the box in the Mobile Partner software on my Mac and pressed enter - and voila, received a message saying that my dongle was successfully unlocked. NOTE that you only get 10 attempts to type in an unlock code! If you use them all up through being careless/mixing up your numbers etc, your dongle will be "bricked" and will be useless - one dead dongle. So be careful when reading and writing your IMEI and the unlock code - double check, triple check, get it right first time!
Just in case the software link doesn't work I've attached it again here