Integrating your OpenGL-based code is technically possible, but likely a bit impractical. It’s hard to say for sure without seeing your code (especially since a long time has passed since you asked this question), but…
Unreal has several layers of abstraction between you the user and the underlying graphics API. You can go down into the guts of the engine and implement your OpenGL calls in there, but to get that code to execute you’ll need to plumb through an interface all the way up to the user-facing bits of the engine. That’s probably a bunch of work.
Similarly you could try to extract only the non-OpenGL bits of your code and lay them on top of UE’s existing RHI abstraction. But you’ll still have to contend with your existing code not fitting the Unreal object model or memory management techniques, and need to adjust it accordingly. Which is probably a bunch of work.
Between the two options, the second is probably easier: adapting your high-level logic to Unreal’s worldview. But unless your circumstances are pretty extreme, I’d be willing to be your best option is to just use Unreal’s UI and rendering solutions for everything rather than try to graft your stuff on there.
Cherry-pick only the highest-level logic or game-specific stuff from your own code, or anything Unreal can’t actually do directly, and otherwise use the tools it provides you.