In most Semitic language, one of the phonemes is a voiced pharyngeal fricative (ע in Hebrew and ع in Arabic). However, in some dialects of Hebrew, namely Spanish-Portuguese, Dutch Ashkenazi, and Italian, the letter ע has shifted from a voiced pharyngeal fricative to velar nasal phoneme. How could these phonemes shift so drastically?
This is an instance of rhinoglottophilia, related to antiresonances and the acoustic structure of these sounds. A parallel case is the change of h to ŋ in the Luyia Bantu language Nyole.
The word "dialect" is misleading in this context. We are talking not about spoken languages, but about reading conventions of a liturgical language, in the same way that (for example) the French liturgical pronunciation of Latin is not a dialect of Latin but a reading convention. In the case of Hebrew, the unfamiliar sounds of the sacred language are replaced by sounds familiar to the speakers of the colloquial language.