Pagan rituals are part and parcel of lots of religions. The easiest way to spread a religion is to incorporate existing traditions into the religion in new areas and make the traditionals and rituals somehow meld with the beliefs of the religion that's trying to expand.
Buddhism is notorious for this. Christianity suffers from it, too. It would hardly surprise me that local variants of Islam had adopted local customs as it spread.