No person shall perform a cruel act on any dog; nor shall any person harm, maim, or kill any dog, or attempt to do so, except that a person may: (1) Defend his or her person or property, or the person or property of another, from injury or damage being caused by a dog: or (2) Kill any dog causing injury or damage to any livestock, poultry or pet animal.