I have a 14 month old daughter and she has a 12 month cousin. We live in the same household and the issue here is that the 12M keeps pulling my daughters hair, pinching her, biting her for everything and my daughter doesn’t do anything. I say no with a stern voice but she doesn’t seem to understand.
At that age you are going to have a hard time teaching a child to fight back appropriately. There's too much nuance in when it's ok vs when it isn't (even adults debate this) for a 14 month old to fully grasp.
You are going to be far better served dealing with it yourself. Protect the children, separate them, console them. If they can't be trusted together, don't let them play together without close supervision and being physically within arm's reach.
You can also talk with your niece/nephew's parents to have them work with their child on learning to not hurt your child (or anyone for that matter). How to handle that is a whole new question that I won't address here. Regardless of what they do or don't do, your responsibility is to keep your child safe. Make that your highest priority. Learning self defense can come (much) later.
Both children are too young to even have a strong concept of "myself" and "other people", let alone "empathy", "fighting back" etc. At this moment in their development it's your responsibility as an adult to stop harmful behaviour by changing the situation. Distract them with something different. Take one child on your arm, to a different corner or into a different room.
What you can do, is starting to strengthen your child's idea of "myself" and their personal boundaries, by not just doing stuff to them, but asking for consent, e.g. when changing the diapers. But you must be ok with getting no for an answer to do that. If you do this, this might help along the way in a few years' time, but it won't make a difference in the short term.
I'm happy to provide a short introduction to childhood development in the English Language: https://www.scholastic.com/teachers/articles/teaching-content/ages-stages-how-children-develop-self-concept/
My primary sources are
- Remo H. Largo: Babyjahre
- Nicola Schmidt: Der Elternkompass
- Nora Imlau: Mein Familienkompass
Maybe this is some use for further reading to those speaking German.
As mentioned in a comment, the approach of asking for consent may lead to harmful situations, where you will have to decide, how far you are willing to go. I do believe that it will actively help your kid to learn to assert itself against violations against their private space, which I understand to be your goal. But you'll have to decide, if this is the right approach for you and your child.