The puranic story of Prahlada tells us about the influence on the unborn child. Prahlāda, while in his mother’s womb, was exposed to Narada’s devotional songs in his hermitage, and consequently became a ‘Bhāgavatottama’, the foremost among devotees.
He was taught by Narada as a child as well. He became a great devotee of Vishnu, to the dismay of his father, the demon-king Hiranyakasipu, who considered Vishnu his mortal enemy.
After warning the child Prahlāda, he had him tortured in every possible way, but Prahlāda survived unscathed. The venomous snakes that were supposed to bite him made themselves into a bed for him to sleep on.
The elephants who were supposed to trample him to death became his docile playmates. Holika, the non-combustible sister of Hiranyakasipu, in whose lap he was supposed to burn to death, burnt to death instead, while Prahlãda coolly walked away, thanks to Vishnu’s help.
Eventually, Hiranyakasipu became so intolerant of his son’s devotion that Vishnu had to jump out of a palace pillar in the shape of a man-lion, the only way to make short work of the demon protected by a variety of boons.
Note that just the environment in which the fetus grows itself has a tremendous impact on it, even without any special effort on the part of the mother to mold it.