First of all, we would like to state that it is not allowed for you to keep a dog at home for a purpose other than hunting or guarding the house (watchdogs). 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.” (Reported by Al-Bukhari and Muslim)
As for the impurity of the dog, the great scholar Ibn Taymiyyah mentions three views of jurists regarding the impurity of the dog:
The First View: The first view is that of the Maliki scholars, who hold that a dog is pure even its saliva.
The Second View: The second view is attributed to the Shafi`i school and one of two narrations from Imam Ahmad Ibn Hanbal. They are of the opinion that a dog is impure even its fur.
The Third View: The third view is ascribed to the Hanafi school and the other narration from Imam Ahmad. They maintain that a dog’s saliva is impure while its fur is pure.
According to Ibn Taymiyyah, the third view is believed to be the most correct. Accordingly, if one’s clothes get wet from touching a dog’s fur, this doesn’t render them najis (impure), while if a dog licks a pot or a container, what it touches must be thrown away and the container should be washed off. Also, if one touches the dog’s fur after making wudu’, it does not break the wudu’, but if one gets touched with dog’s saliva, then one has got tainted with najasa (impurity) which must be removed.
The late Sheikh Sayyed Sabiq (may Allah bless his soul) also gave preference to the opinion of the Hanafi school. He states in his book, Fiqh-us-Sunnah:
“Dogs are considered impure. Any container that a dog licks must be washed seven times, the first time with pure soil. Abu Hurayrah reported that the Messenger of Allah (peace and blessings be upon him) said: “Purifying a container that a dog licks is done by washing it seven times, the first time with pure soil (that is, water mixed with earth until it becomes muddy).” (Reported by Muslim, Ahmad, Abu Dawud, and Al-Bayhaqi). If a dog licks a pot that has dry food in it, what it touches and what surrounds it must be thrown away. The remainder may be kept, as it is still pure. As for a dog’s fur, it is considered pure.”
Given the above, it becomes clear that touching dogs or being in contact with them does not render one’s body or clothes impure. This is based on the opinion of a group of Muslim scholars including Hanafi scholars who say that only the dog’s saliva is impure but not its fur. So, if you touched a dog’s fur and not its saliva, then your body and clothes are pure.