The Sassanian Empire hugely influenced the Muslim world. The mosque being based on Persian architecture, it gets easy to see this. The Persians were really the true elite in the region and thus many practices are picked up on by the invaders. Given that having a Persian speaking elite at the top and a Persian populace on the bottom with a warrior class of Turks or what have you in the middle, there's a lot borrowed between the two.