Fatwa ID: 02623
Answered by: Maulana Maruf Ahmed
Is combing the hair and beard in the mosque after ablution permissible?
It is considered an etiquette to look after the hair, and this includes combing it regularly.
The Prophet said: “Whoever has hair should honour it.”
However, it is advisable to comb the hair outside the masjid. This is understood from the following hadith narrated in Sahih al-Bukhari:
A’isha stated: The Prophet used to bend his head (out) to me while he was in Itikaf in the mosque during my monthly periods and I would comb and oil his hair.” 
Only Allah knows best.
Written by Maulana Maruf Ahmed
Checked and approved by Mufti Mohammed Tosir Miah
Darul Ifta Birmingham
 Sunan Abi Dawud, Hadith no. 4163