I know this is an old post, but I came across it while searching for answers on how to address my own son's misbehavior, and thought I'd come back to add what I've learned that hasn't already been mentioned for others like me searching for answers.

The reason your son says he doesn't know why he's hurting the dogs could be because he genuinely doesn't know that he is hurting them, or why he is hurting them. He could still be learning cause and effects at the age of 5, so it is good to teach him why. "When you __________, _________ happens...." or "I don't like it when you _______, because_______."

Another thing I picked up on is that the boy may misbehave because he hasn't learned how to express his anger and frustrations. He may have have not been taught the words to match his emotions, or worse, he has been physically abused by an angry adult. In such a case, spanking could be learned as acceptance to hit someone when they are angry, especially if the child doesn't understand why they are being spanked. 

I used to ask my own son why he was hitting, and he also told me "I don't know" with a confused look on his face. What he did understand was "hitting hurts". I asked him if he wanted to hurt me or the dog, and he shook his head no, and said he was sorry with tear filled eyes after I told him he hurt me or the dog. Then I asked him how he felt before he hit so that he can learn words for those feelings. Then I taught him what he can do instead when he feels that way again, such as going to a quite place, hitting a pillow or physical activity, or talk about what is upsetting him, etc. Now when my son is angry, he will shout "I'm mad at you!" and walk away for a time out to feel and think until he is ready to talk more about it, or he starts playing when he's over what he can't change. We are still working on not needing to shout when someone can hear his normal tone, but it is a work in progress.

The good news is that it is normal for children to go through a stage of defiance around the age of 5 when they are testing their new found independence against our authority. The defiance will subdue if they feel secure in knowing that we care, we listen, we understand, and we are predictable with expectations and consequences. All children are different, but what is the most effective consequence for my son's bad behavior is taking something valuable from him, like his favorite toy, and return it after he exceeds my expectations. It started with good behavior for 1 day, then expanded to a reward for 1 week of good behavior, or good behavior and doing homework and chores. I was told by an expert that we don't want to reward them for what is expected, otherwise they will expect rewards for minimal effort, but we can reward them for their effort to exceed our expectations. 

I hope this helps.