This was a common practice for the Catholic Church as recent as a few hundred years ago. The way they evangelized was to slowly take over religious sites of other faiths. Dig under any older Cathedral and you’re likely to find a more ancient religious site. Muslims are just more aggressive, that’s all.
My FRiend the story goes both ways.
Beneath the Basilica of San Clemente in Rome they found a 2nd century mithraeum—a temple to the god Mithras.
But the mithraeum itself was a converted 1st century Christian House Church, probably owned by Flavius Clemens, who was executed for “atheism” and Jewish customs.
I can’t prove it was given to the Mithraists specifically to paganize the formerly Christian site, but I wouldn’t put it past them either.