While the process you describe happens, you cannot generalise to "most mosques".
The radicalisation of Muslims, not only in the West, but also in Muslim countries, is usually caused by specific branches of Islam.
In particular, prior Islamist terrorists have often been brainwashed in Salafi mosques financed by Saudi Arabia. It's the same in subsaharan Africa. The rise of terrorism is correlated with the diffusion of Salafism.