There is evidence that the human brain can detect magnetic fields on an unconscious level, although it's far from settled science.
https://www.science.org/content/article/humans-other-animals-may-sense-earth-s-magnetic-field
I think it is entirely possible that we have vestigial magnetosensitivity from hundreds of millions of years ago. If that is so, however, it gives us the potential to redevelop it in the future.
There's also a way to fake it- people have made haptic "compasses," wearable devices like belts which vibrate north at all times. I remember reading many years ago about the first scientists to develop the technology and the first person (one of the scientists) to try it out, and he said that he was able to know where north was for a long time afterward.
I should say I was only talking about the first part when I meant faking it. We really don't know if wearing the device made him temporarily (I think it was temporary) magnetosensitive or if he just got so used to where north was in his daily routines that it was just memory.