It could. Apple AirPods actually support this (using a real "Audiogram") but annoyingly they currently "average" your two ears and don't apply an ear-specific correction. Which for someone like me with perfect hearing on one side and supposedly "Mild" but realistically quite significant hearing loss on the other side is a real pain.
There are already quite a few products in this space:
Bose HearPhones
Nuheara
.. and many more.
There are already quite a few products in this space: Bose HearPhones Nuheara .. and many more.