First of all, to keep a dog at home for a purpose other than hunting or guarding the house (watchdogs) is strictly not allowed in Islam. The Prophet (peace and blessings be upon him) is reported to have said: “Whoever keeps a dog save for hunting or for guarding crops or cattle will lose one large measure (qirat) of his reward each day” (Al-Bukhari and Muslim).

In his response to your question, Sheikh `Abdul-Bari Az-Zamzami, a member of the Moroccan Scholars’ Association, states:

“Touching a dog does not nullify ablution because acts that nullify ablution are well known and touching a dog is not one of them. It should be noted that living animals such as dogs are not impure. Therefore, there is nothing wrong with offering Prayer in a place where dogs are roaming or passing, as Al-Bukhari reported in his Sahih that dogs used to enter the Mosque of the Prophet (peace and blessings be upon him) and then come out.”