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 be disobedient is because he hasn't learned how to express his emotions. Children at 5 years or less are may not know how to express anger, frustration, hunger, tiredness, overwhelming, boredom, etc. Or worse, if the child has been physically abused by an angry adult, 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 saying, then said he was sorry with tear filled eyes after I told him he did hurt me or the dog. I asked him how he felt before he hit so that he can learn words for those feelings, and helped him decide what he will 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.
Another possibility is that your 5 year old could be disobeying TO GET a reaction out of you. Whether it is for attention, or to get a reaction, they are learning how to manipulate the situation through the cause and effect I mentioned earlier. The best defense for this is to try to prevent situations where the behavior tends to occur, such as keeping him separate from animals and small children. Then try to not over react to his behavior, because you could be positively reinforcing the behavior by your actions, therefore increasing it. Sometimes to stop bad behavior, you have to ignore it or keep a poker face when you can't. I've walked away while my son throws newly folded towels on the floor, because when I told him not to, he would continue to do it while smiling at me. Now if he doesn't stop, I'll take away his favorite toy, and he doesn't get it back until he folds all of the unfolded laundry, and puts it away no matter how messy it is in the end.
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.