This is an interesting question, and not one that most doctors
have significant exposure to. Nonetheless the best thing to do is to speak with your doctor about your concerns. There are several possible explanations that could be used, but it is somewhat apparent that this is a question that may not have a perfect answer. First, I would need to know how you know that your nipples taste like onions, as that could be one potential source of the taste. If this has been confirmed through multiple sources, then it would be more likely to be true. If this was only a single person on a single occasion, it could possibly be related to something that you ate. There are times that we eat things that can then come out through our skin. Garlic is well known for this, as are onions, and the taste and smell that they give off to bodily secretions and the skin can be noted by other people. If you are a person who eats large amounts of garlic and onion this could explain why you have had this symptom in the past. There are obviously many other possibilities as well, but when people have changes to their skin or the smell and taste of these, above are some of the possibilities. Please speak with your doctor about your question.