Please know that I am not a doctor or a gynecologist.
In researching your question it seems that there can be many reasons for an ammonia smell in your underwear. Things like bleaching your undergarments can produce this odor, or sometimes sweat can also cause this ammonia smell. I am reading that sometimes what you eat can be responsible for such a smell and eating a more bland diet can help.In other cases an infection can be the culprit such as bacterial vaginosis or a urinary tract infection.
If this continues your best bet is to ask your doctor or gynecologist about the odor and what could be the cause.
Hope this helps. Thank you for your question.