Yes, it can. But we mange the degree of how much it does affect us.
As an example : a person lives in a country where a lot of people behave badly (as to this person's opinion). Does that mean this person will change and do the same?
That entirely depends on the person themselves.