OpenGL is good for learning 3D graphics, but isn't used in games any more. It'd be better to know DirectX 12 and Vulkan, but those are hard to impossible to learn without experience with some other API first IMO.
Just learning Unreal Engine will keep you from getting hired for a lot of jobs that don't involve that engine (for example, all Unity projects). Being a general graphics programmer opens a lot of doors.