Giffgaff do indeed use O2 (which is also owned by the same parent company, Telefonica).
Three can still unlock the phone, even if you didn't hold the original contract but you need an active Three pay as you go SIM and credit on, you might have to leave the SIM in the phone for a while (O2 say for 30 days, Vodafone said 28 to me when I had an iPhone 6 unlocked) but they will unlock it for you, the question is, how much they'll charge you?
I think it' might be free on Three but might be between £4.99 and £14/£15 (I know one network charges £4.99 to process the unlock) so might not be worth it, giffgaff SIMs come with £5 free but you need a minimum top up to activate the SIM and that's £10/£15 minimum giffgaff and/or O2(you can use either of the networks topups and also tesco mobile but they all have a £10/£15 minimum value), even if it cost £4.99 to unlock, do you want to pay £20 to get £25 back? (or pay £20 for £5 credit)
[EDIT]Have a look here, this page seems to think it might be already unlocked if purchased after 2014 but it has a drop down box checker type tool to find out using make/model info:
Unlocking a Three device to use with another network. - Managing your contract - Bills & contracts - Support - Three
You will still need a pay as you go Three SIM, in the phone but you could fill out this form:
Device support.
I see no mention of a charge but you need to enter the Three mobile number on that page, it's best to put the Three SIM into the phone to be unlocked and call the Three SIM from another phone for 1 minute or so, just to log the IMEI to the SIM, then call the topup line for a minute to log an outgoing call, then fill out that form and see what happens
[/EDIT]