Each person, when he/she is engaged in self-education, selects for himself such sources of information, which contain information that fits into his/her worldview. If he/she is an atheist, he/she reads books about evolution; if he/she is a believer, he/she reads books about Christian wonders; if he/she is for the Democrats, he/she visits the media of the Democrats, if for the Republicans - the media of the Republicans, respectively. The information that does not fit into his/her worldview causes unpleasant feelings for him/her - cognitive dissonance; and to avoid these unpleasant feelings, he/she usually denies this information - declares it a fake, “photoshop”, or he forgets it.
I believe that education makes a person more dogmatic, because the modern education system only provides knowledge that fits into the overall picture (at least I see such a situation in Russia).
We can conditionally say that the worldview is formed by the books that were accidentally read in the first place (or other sources of information).
There is an observation that believers are less likely to read the Bible than atheists. This is due to the fact that atheists consider the Bible to be a set of fairy tales, and accordingly reading it does not cause cognitive dissonance in them; believers find facts in the Bible that do not fit into their picture of the world, this causes them cognitive dissonance and they stop reading.
It seems that this phenomenon has been intensified in the past few years. Roughly speaking, previously a person used to watch the news to get new information, but now he watches the news to get the confirmation of his point of view.
It can be said that a smart person is the one who is not afraid of cognitive dissonance, or, more precisely, is ready to endure it until a new understanding comes (at a deeper level of knowledge).