With my kids, my wife and I teach the idea of consent from a really young age and reinforce it strongly amongst family members. No means no as long as it's their body or their possessions
And we back that up, forcefully. If my kid doesn't want a hug, they will not be getting a hug. If they don't want to share, they won't.
My kid's autonomy is worth way more than those relationships. Period.
And it's worth it. Your kids will naturally share when they feel comfortable doing so. They'll share affection when they feel comfortable. And longer term this extends into topics they're not mature enough to tackle at 3