Teaching kids to stand their ground

I need advice on how to teach kids how to stand their ground without being mean 😩

I'm not a perfect Mom by far but I'm trying to teach my kids (3y.os) kindness and respect. I take them to the childrens museum at least once a month and it seems every trip there's a run in with a kid. Mine could be playing with a toy and a kids would steal it and they do nothing. They'll look pretty hurt but they just walk away not saying anything. The Moms usually give the toys back and apologize but by then they are on to something else.

The only thing I can think to do is explain to them that some kids are mean and sometimes they don't mean to be but they have to let them know that they were playing with it...but I also don't want them to start a toddler fight lol

At home they steal toys from eachother and they'll get defensive but around other kids it's the opposite. I grew up being walked all over because I was nice. I want my kids to be kind but also want them to know they have to stand up for themselves too.