I think OP, what you're trying to teach your daughter is so important. I am a mum of two girls (preschool and young primary age) and it astounds me sometimes when I read on here of grown women who get in a terrible flap around just saying 'no' to someone, or asserting themselves.
I am neurodivergent and I think - for me - one of the benefits that is I have far less self consciousness around being direct than my neurotypical friends do. It doesn't register with me often to be bothered if people think I'm a bit bolshy because I'm happy to assert myself. I don't care.
It displeases some people sometimes, but I am never rude (really I'm not, I might be ND but I'm nearly 40, I know what rude is), always polite but firm. One of my children is also ND (she's a mini me) and so it's really important to me that she's clear on her own boundaries especially regarding physical safety and space. She won't pick this up as easily as her NT friends so I teach her as and when things crop up.
For me, modelling is important. I don't allow people to speak to me rudely or disrespectfully anyway but especially not in front of my children and particularly if it's men. I will calmly challenge it if it happens. It doesn't often. No passive aggressive digs in response, no apologetics in the face of someone else's rudeness. I will calmly and cheerily tell someone what they've just said was rude or disrespectful and say that I don't expect them to speak to me like that again. It takes people by surprise and men (it's nearly always men!) bluff and bluster at their rudeness being remarked upon so directly.
I teach my children that whilst sharing their belongings/toys is nice and I encourage them to do it, that it's fine to have boundaries around it and if something is particularly precious to them then they can put it up and decide not share it. I don't like to share my belongings much either but no one expects me too. It's no different for children unless they are shared group items like in school or playgroup and then they don't get to be precious about them. If it has their name label on at school it means it comes from home and they can choose if they share it or not.
I've taught my eldest (hasn't come up with the youngest yet but no doubt it will) that if someone invades her personal space at school or elsewhere then she can put her hand up in front of her chest in a 'stop' signal (not to hit, very very clear on that) and say 'Stop, I don't like you being so close to me. Move back please' Equally important if people are touching/hugging her like kids can do and she doesn't want them to 'Stop touching me please' which escalates to 'Take your hands off of me now'.
Same rules apply if people say rude things. Call it out, but politely and calmly. 'That was a very rude thing to say to me, it hurt my feelings. I'm going to go and play with someone else now'.
All these sorts of little things will build our daughters confidence as they go. They don't need to be aggressive, or shouty or rude, it's important that they're not actually - but they do need to learn that they are valuable people and that it is perfectly ok to look after their own interests and feelings as well as being nice people. 'Be Kind' sure, but not to your own detriment!