Generally speaking, Muslims should not keep a dog in the house as Imam Al-Bukhari reported that once Gabriel promised the Prophet (peace and blessings be upon him) that he would visit him, but Gabriel did not come and later on he said, “We, angels, do not enter a house which contains a picture or a dog.”. However, Muslims scholars make an exception for guide dogs for the blind.) But there are legitimate reasons for keeping dogs that are kept outside the house. In addition to hunting and guarding, they are used in herding, tracking and other police work, and rescuing disaster victims. It is permissible to benefit from dogs in these ways, and the majority of scholars permit selling dogs that will be used for such useful purposes.
Dr. Taha Jabir Al-`Alawani, Chairman of the Fiqh Council of North America, states the following: “Islam looks at animals as creatures that have rights and important roles in the natural environment. Therefore, as a rule, an animal has the right to be free to fulfil its role in nature without harming it, unless it is a harmful creature and causes damage to property and environment. For this reason, Islam does not encourage keeping dogs away from their natural environment and restraining them in houses because doing so may make them unhappy, even though they do not know how to express their feelings.
Having stated this, I would like to add that if there is a definite benefit from keeping a dog at home, such as hunting, guarding, guiding blind people, etc., it will be lawful to restrain its freedom for specific advantage to human beings. Allah Almighty says, “And He has subjected to you, as from Him, all that in the heavens and the earth: behold in that are Signs indeed for those who reflect.” (Al-Jathiyah 13)
On the one hand, it is not permissible to retain an animal and restrict its freedom for amusement and entertainment. On the other hand, Islam considers hunting or guarding dogs [or dogs trained for other purposes such as guiding and rescuing] as respectable possessions that can be traded for acceptable purposes.”
Moreover, Sheikh `Atiyyah Saqr, former head of Al-Azhar Fatwa Committee, adds:
Imam Muslim narrated in his Sahih that the Prophet (peace and blessings be upon him) is reported to have prohibited the price paid for buying a dog. In his commentary on Imam Muslim’s narration, Imam An-Nawawi stated that the prohibition mentioned in the hadith is meant for selling dogs in which there is no benefit. Selling and buying such dogs is prohibited according to the above hadith.
However, some Muslim jurists, such as Imam Abu Hanifah, stated that there is nothing wrong in buying and selling dogs in which there is benefit that can be gained from that, for example when the dog is kept for the purpose of hunting or guarding. Ibn Al-Mundhir, `Atta’ and An-Nakhi`e state that it is permissible to sell hunting dogs.
On the other hand, Imam Ash-Shafi`i states that trading in dogs is totally prohibited. However, Imam Malik states that trading in dogs is permissible irrespective of whether the dog is for guarding, hunting or any other purpose. Imam Abu Hanifah states that the permissibility in dog’s trade is restricted to hunting, guarding dogs and for dogs that are kept for a religiously acceptable reason in which there is no harm inflicted upon the buyer (such as buying a dog to guide a blind man).”