Yes and research has proven it.
This has been well known for generations among the families of India's hereditary classical musicians. So many of the classical Indian music geniuses were born and raised in families where they were immersed in music from in utero. One or both the parents, and extended family would practice music, hold music classes, etc, and these sounds were always in the air. Often, parents would deliberately play or sing very near the expecting mother just to enhance exposure.
Ancient Indian epics contain stories of heroes who learned vital bits of information by being taught in utero. So the concept is not new. Expectant women are encouraged to listen as much as possible to soothing music, chants, sounds, etc, to promote calm and harmony for themselves and their coming children.
No wonder beginning from infancy/toddlerhood children in these families show signs of being musically precocious and very readily take to training and show superior performance. They get enhanced training (through continual exposure and age appropriate training when older) from infancy.
Nature and nurture; genes and environment all work together to produce the best results.