Answered by Shaykh Faraz Rabbani
What is the ruling if a dog touches you or your clothes i.e. his nose or other parts of his body? And what if you touch it?
Walaikum assalam wa rahmatullah,
The dog itself is not essentially filthy (najis al-`ayn) in the Hanafi school, unlike pigs. However, its saliva is filthy. Thus, touching a dog does not make ones body or clothes filthy. [Shurunbulali, Imdad al-Fattah] For details, see:
Dogs Coming in Contact with Clothing
Keeping a dog
This is unrelated to keeping a dog–this is impermissible, for other than genuine needs (such as shepherding or guarding), as established by many rigorously authenticated hadiths of the Messenger of Allah (Allah bless him and give him peace), as explained in the following answer by Shaykh Ilyas Patel of Qurba Institute (UK):
Keeping a Dog: Impermissibility Explained
And Allah alone gives success.