Firstly, it's important to be aware that some dogs may not react well to physical touch – particularly if this was their original reaction when you hurt them. If your dog doesn't seem receptive to touch at all, walking away from them may be the best course of action whilst you formulate an apology. Secondly, remember that your words are just as important as your actions when apologizing to your dog. Make sure that you use a calm voice and lots of eye contact, conveying that you're truly sorry for what happened and offering your condolences. Finally, try providing some tangible emotional support to your dog if they seem distressed or upset after being hurt - this could include stroking them or sitting with them whilst they feel comforted.