There are a few things you can do, but, IMO none are foolproof but will help some.
1...Use a SHARP knife.
2...Put them in the fridge before cutting 30 mins or so.
3...Cut root end first.
All the other ones like, bread in the mouth, candle burning, stove lit, cutting with your mouth open ect....is bunk. The one thing that will work no matter what is wearing goggles, but then you have to explain why you are wearing swimming goggles while prepping your onion LOL. Be sure you wash your hands well after handling things like onion, garlic and spicy peppers, all are eye irritants.
Just because someone tells you that you can't do something doesn't mean you have to listen.