Keeping a dog should require a license: https://www.theguardian.com/lifeandstyle/2023/sep/20/bring-back-the-dog-licence-with-a-test and to get the license you should have to pass a test in how to teach a tog to be friendly rather than aggressive. There could be alternate tests for training guard dogs, where the trainer would have to demonstrate ability to train a guard dog so that it will keep its actions within the bounds of what is acceptable for such dogs.