My wife had hair loss in some parts of her head and was losing hair while bathing. Her sister told her to try onion oil. So she boiled onions in mustard oil and applied it to her scalp. She left it for 1–2 hours before washing it off. It really helped. Her hair fall stopped after a few uses. But one small side effect was that a few hairs turned white. Still, it worked well overall.
I have tried homemade onion shampoo mainly to make my hair grow faster, not specifically for hair loss. It makes hair grow a bit faster; my theory is, if it promotes overall hair growth, it surely helps with hair loss. I also noticed that it thickened my hair. It's a good option to add to your routine if you suffer from hair loss and see if it works for you.