Assault is assault. In what universe do you imagine someone not caring if you walked up and attacked their pet or farm animal? Violence is often used to resolve disputes in Skyrim, so it's no surprise that you would be attacked for such a vile act. If the guards don't recognize your attempt to yield, leave the city and come back. You'll likely be given the opportunity to pay your fine and be done with it.
Skyrim is a game with consequences. Attack things "out of amusemant" and you'll likely provoke a response in kind.
Killing a chicken (5g bounty) should not result in every living being in the entire hold seeking to cut me to pieces without chance for repentance. You do not need to explain that actions have consequences, that would be as informative as telling me that the sky is blue on a clear summer day.