Yes it is permissible to have a dog as a pet but you must be careful as it is an impure animal (Najis) like pig and you should not let it make your clothes or plates or home items impure (Najis).
If you want to keep a dog as a pet, keeping a dog in your garden to guard your house or garden is allowed as well, and it has no risk of making your home items as impure.
Wassalam.