My little one is like that. She had been in the same preschool since 19 months old and the school had no problem with the children giving hugs. With that (moving forward to 5YO), when she would meet someone new, could be a neighbor, could be a new friend at school, or could be another kid in a shopping cart, she would say I want to go give them a hug. We would allow her to, but only if the other person wanted the hug. So she learned to ask if she could give hem a hug.
Now in Kindergarten, they don't allow any touching during class, not even a high 5. However, in after school care, they are allowed to hug and she give hugs good bye to some of her most special friends. Sometimes the school has outings and she sees some of her friends and they run to each other to embrace like they haven't seen each other in years.
So I would just remind her that not everyone is comfortable with hugs and she should ask and be prepared for some kids to not be comfortable with a hug.
It is so special to see the love of children.