Rules don't govern character personality
Mechanically, issues relating to characters' personality and past are almost non-existent in DnD 5e: only race, class and to a lesser extent background are important. As long as you're ok implementing this concept without any extra skills or other mechanical perks, whatever your character is like has no mechanical ramifications, assuming you don't try to squeeze out special rulings from your GM based on your character's special nature.
However, even if there is no mechanical obstacle, you should always consider the social side when thinking about character concepts. Playing an RPG is largely about sharing a story with the other players, including the GM. The backstory and character trait of having two personalities may seem cool, but it could also turn out to conflict with what everyone else is expecting of the game.
I recommend (in general --- not just in this case) that you create characters together, sharing feedback and suggestions, because that helps you choose interesting dynamics to focus on and prune out those that don't work. Your split personality/past needs commitment from other players in order to be more than just a gimmick, and if it feels like you can't secure that commitment, it's better to leave that concept for another game.