Praise be to Allaah.
Islam forbids Muslims to keep dogs, and the punishment for that is that the one who does that loses one or two qiraats from his hasanaat (good deeds) each day. An exception has been made in the case of keeping dogs for hunting, guarding livestock and guarding crops.
If you touch the dog with a dry hand or when the dog itself is not wet, then your hand does not become impure, but if you touch it when your hands are wet or when the dog is wet, this means that the hand becomes impure, according to the opinion of many scholars, and the hand must be washed seven times, one of which should be with earth.
Muslim (279) narrated that Abu Hurayrah (may Allaah be pleased with him) said: The Messenger of Allaah (peace and blessings of Allaah be upon him) said: “The purification of the vessel of one of you, if a dog licks it, is to wash it seven times, the first time with soil.”
Al-Nawawi said in al-Majmoo’ (2/598):
The scholars differed concerning the licking of a dog. Our view is that it makes whatever it licked naajis (impure), and the vessel must be washed seven times, one of which must be with soil. This is the view of the majority of scholars. Ibn al-Mundhir narrated the view that it is obligatory to wash it seven times from Abu Hurayrah, Ibn ‘Abbaas, ‘Urwah ibn al-Zubayr, Tawoos, ‘Amr ibn Dinar, Maalik, al-Awzaa’i, Ahmad, Ishaaq, Abu ‘Ubayd and Abu Thawr. Ibn al-Mundhir said: This is also my opinion. End quote.
With regard to vessels, if a dog has licked a vessel (i.e., drunk from it), then the vessel must be washed seven times, one of which should be with earth, as was proven in al-Saheehayn and elsewhere, in the hadeeth narrated from Abu Hurayrah (may Allaah be pleased with him) who said that the Prophet (peace and blessings of Allaah be upon him) said: “If a dog licks the vessel of any one of you, let him wash it seven times, one of which should be with earth.” It is better if the washing with earth be the first washing.
And Allaah knows best.