It is best to avoid hugging your dog or cat because, although a tight hug is often a sign of affection between people, it can feel threatening to a dog or a cat. To survive in the wild, dogs and cats had to be able to use their bodies freely and being held down or restrained usually meant they were in serious trouble (such as being caught by a predator). Therefore, instinctively a dog or cat can become afraid when restrained, such as when held in a hug.
Most dog bites in young children occur if the dog is resource guarding (for example, guarding their food) or during seemingly safe interactions such as hugging [1, 2] or petting. Behaviours from children that have the potential to provoke aggression from a dog include rough play or handling, running after or chasing a dog, hugging, kissing, or crawling on a dog, reaching to pet an unfamiliar or neighbourhood dog, teasing, taunting, yelling, screaming, squealing or barking at a dog and reprimanding a dog .
Restraining or hugging cats can cause them to become afraid and frustrated . This is a natural and common response of the cat when they feel they do not have control over a situation and can be associated with aggressive behaviour when they are irritated or restrained . In the wild, cats are a generally alone and the need to be in control is an essential part of their survival behaviour .
In general, it is best for both adults and children to avoid hugging their pets and instead interact with gentle pets/strokes for dogs preferably along their shoulders avoiding the top of the head and chin or face rubs/strokes/scratches for cats.
 Reisner I, Shofer F, Nance M (2007) Behavioral assessment of child-directed canine aggression. Injury prevention: Journal of the International Society for Child and Adolescent Injury Prevention, 13: 348-51.
 Landsberg G, Hunthausen W, Ackerman L (2012) Behavior Problems of the Dog and Cat. Elsevier Health Sciences.
 Shaw J, Martin D (2014) Canine and Feline Behavior for Veterinary Technicians and Nurses. John Wiley & Sons.
 Heath S (2018) Understanding feline emotions: … and their role in problem behaviours. Journal of Feline Medicine and Surgery, 20(5): 437–444.