Humans are primates and show affection by hugging but hugs for a dog give a very different message. Dogs are canids and will put their paws on another dog to show dominance. If the other dog accepts the dominance then there is no problem but if not it can lead to a fight.
You could spend a lot of money on toys for your dog but really what the dog wants is your time. 10 minutes tugging on an old rag with you, or throwing a ball will make the dog much happier than an hour spent alone with the most expensive dog toy.
Affection is different things for different dogs. My dog likes to be near to people when he sleeps and will often go to sleep with his head on someone’s feet but for other dogs being touched when they are sleeping is a cause for anxiety and they may growl to warn you away.
A dog that has been deprived of basic care will see things such as food, water and a comfortable bed as affection. You could show a high energy dog affection by taking it on a long walk or to an agility course. Affection for a low energy dog would be snuggling up on the sofa with you.
Leadership is another way of showing affection. Some dogs are naturally followers and need to feel they have someone who will give them direction and keep them safe. They are pack animals and need to feel comfortable in their pack. They don’t care what car you drive or how expensive your house is. Any car that takes them to the park to run and sniff is amazing for them. As long as they have company and they are warm, dry and well fed any house will do.
As pack animals dogs hate to be alone for long periods. Most dogs want to be around people but that doesn’t mean they want to be touched by people most of the time. Showing affection doesn’t mean stroking, cuddling, grooming or dressing up dogs. These are all very human ways of affection and not always appreciated by dogs.
Once you get to know a dog you will become more aware of the affection it seeks. It could be food, play, exercise, company.
Dogs, however, are very good at showing affection to us humans. They quickly learn what pleases us and even if it is something that they would never do with another dog, if it gets the result they want they will do it again and again for their human.