Strictly speaking it's not "in cfw2ofw format" (I don't think it's technically correct to call it a format in the first place) but yes, it's possible to convert a disc title to a digital one (likely with compatibility restrictions - I'm personally familiar with the opposite conversion and success rates are far from stellar)
First, you need to open the (extracted, aka JB format) game's PARAM.SFO and change its category from DG to HG
Then you need to decrypt "retail" [disc format] executables (eboot.bin and SELFs if any) and reencrypt them in "npdrm free" [digital format, protected by a systemwide fixed key - ie not needing a license] mode - I can't really help you here because I'm not familiar with the technicalities, and the frontend I use for these conversions (Essse Resigner) doesn't support going this way...
Then, I'm even less familiar with those, but I imagine EDATs if any will need similiar processing (haven't seen any in my disc games)
Finally, throw away everything except the PS3_GAME folder, rename it to the titleID, and upload to dev_hdd0/game/, then rebuild database - it's supposed to show up in the XMB, whether it will work is a rather different question
Of course, the lazy and not always applicable but easy and guaranteed solution is to obtain a legal copy of the PSN version of the game...