Bismihi ta'ala
You would be allowed to have a shepherd dog or a guard dog, and it will be very useful to do so. Keep in mind that a dog is still externally najis, and you must still treat it as such. For example, if the dog is wet, and it touches you, or you touch it, or it licks you, or its hair gets onto you, etc, then you will need to purify yourself.
It would also be important for you not to allow the dog inside your house, or in areas you need to keep tahir, and so on.
And Allah knows best.