Bismihi ta'ala
In Islam, the two animals pig and dog are najis. There is no exemption for pig, but in regards to dog, one is able to own a dog if it is used for hunting, a Sheppard dog, or for security. In any of these cases, the dog is still najis and related ahkam stay relevant to it. One can keep a dog, but must observe all aspects of taharah/najasah regarding it.
And Allah knows best.