All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad is His slave and Messenger.
We ask Allah to help us and you stay firm in obeying Him, and we say to you, “A Muslim is not allowed to keep a dog as a pet except for the purpose of guarding or hunting.”
It has been proven that the Prophet said: “Whoever keeps a dog, one Qiraat of the reward of his good deeds is deducted daily unless the dog is used for guarding a farm, cattle, or for hunting.” [Muslim and Maalik in the Muwatta']
For this reason, we advise you to quit keeping the dog as a pet, if it is not kept for (the purpose of) guarding, because this will decrease on daily basis your good deeds; and to reduce one's good deeds daily is more than a sufficient punishment for a person who hopes (believes) to meet Allah.
The Muslim should surrender and comply with the Commands of Allah and His Prophet and that is a proof of the sincerity of one's true faith and perfect love to Allah and His Prophet . He should prefer what is with Allah as reward and give it priority over one's passion and personal desires, as Allah Says (what means): {It is not for a believing man or a believing woman, when Allah and His Messenger have decided a matter, that they should [thereafter] have any choice about their affair. And whoever disobeys Allah and His Messenger has certainly strayed into clear error.} [Quran 33: 36]
As for not finding a special text in the Quran that prohibits the possession of dogs, then this is not a justification, as Allah Says (what means): {And whatever the Messenger has given you - take; and what he has forbidden you - refrain from. And fear Allah; indeed, Allah is severe in penalty.} [Quran 59:7]
Moreover, the Prophet has forbidden keeping dogs as pets unnecessarily without a need to do so.
As for the prayer of the person who keeps a dog as a pet, it is valid and acceptable, Allah willing, if its obligations and compulsory acts are correctly performed, and so is his fasting but he (the person) should take utmost care that the dog does not touch his body, his clothes, and his place of prayer.
We draw the attention of the inquirer to the fact that the obligatory prayer is five prayers per day and night as is indisputably recognized in religion, and thus four prayers will not suffice or replace this. But if the Muslim adds (performs) the Sunan and Rawaatib (supererogatory prayers either before or after the obligatory ones), then this is better.
Also, we draw her attention to the fact that angels do not enter a house where there is a dog, not because they are afraid (of dogs), but because the dogs are naturally impure, unclean and mean (animals) and they are of the devils. While contrary to dogs and devils, angels are a sign of purity, cleanliness, happiness, blessing and tranquility.
For more benefit on legitimate reasons for keeping a dog, please refer to Fataawa 324532, 419983, 92109, 81421, 91174 and 85829.
For more benefit on the ruling of the impurity of dogs, please read to Fatwa 82644.
Allah knows best.