Answered by Shaykh Faraz Rabbani
Is it valid for one to prostrate in prayer on clothing that one is wearing, for example a woman prostrating on her hijab?
Walaikum assalam wa rahmatullah,
It is permitted, though slightly disliked (makruh tanzihan) without reasonable excuse, to prostrate with something (such as cap, turban, or hijab) preventing one’s forehead from directly touching the ground. [Shurunbulali, Maraqi al-Falah]
It is stated in Haskafi’s Durr al-Mukhtar, commenting on Tumurtashi’s Tanwir al-Absar:
“(It is somewhat disliked to prostrate on the wrapping of one’s turban) unless there is an excuse (even though it is valid) according to our school (on condition that the prostration occur over one’s forehead) in whole or in part.”
One should seek to avoid this, however, as it renders one’s prostration (and, ultimately, one’s prayer) invalid in the Shafii school. [Nawawi, Majmu`, 3.397]
Wassalam,
Faraz Rabbani