Hey there
An interesting question. O2 will need the IMEI to issue a PUK code but may refuse to do so due to security (I.e. proving you are the owner).
Also note that the device will likely only be good for calls and texts now as some of the networks have now turned off 3g entirely and the rest plan to.
If I were you I would recycle it and buy a cheap device from a supermarket or similar for a few pounds for what this will give you.
S24 Ultra