Some dogs do like to be hugged while others may not like it.
If you have a dog you can try giving it a hug and if they start to growl then that means they don't like the hugging but I've had dogs before that loved hugs and I gave them a hug everyday when I came home from work.
The dog would run and jump on me when I came home from work because it was glad to see me and I would embrace the dog in a hug and he loved it.
But some dogs may not like the hugs and that's okay too.