Could you site the law please?
Also I've always heard that the cop dog is considered an officer.
I believe in this situation I would try to protect the dog. If at this point the attacker stopped, fine. Call cops prepare to sue for property damages. If the attacker turned his attack toward me and I thought I was in danger of serious bodily harm I would use whatever force allowed by law to stop it.