Humans are, by nature, creatures that live in society. In fact, so much so, that they can’t survive without one. Namely, unless you have at least another human to look after you once you’re born, you will die.
Moglis aside, more than another human, God made it so that naturally we are born into a society: our Families
All this to say: ideally, your environment teaches you the things you need to know before you can comprehend them, and as we reach the age of reason, where we start to grasp the reality beyond our immediate senses, than, most certainly our will directed by our reason has the power to have us act differently and even in opposition to our environment or past experiences
Wether a given person will be more determined by their environment or by their own reasoning upon the things they learned from their environment, varies wildly from person to person.
There is a saying, however, that should serve as warning: those who do not live the way they think, end up thinking the way they live.