I pray to Allah to bless you to perform a virtuous hajj.
As you should know well in Islam when there is a real hardship the rigor of the laws is relaxed. So, if you are suffering from a medical condition that requires you to wear underwear you may do so; however, you should redeem yourself by fasting three days or feeding six poor persons or offer a sacrifice. It may be to follow the second option if you are unable to fast. You may send the amount to help the refugees from Burma.
The above ruling is based on the advice of the Prophet (peace be upon him) to Ka'b b. Ujrah who was suffering from infestation of lice in his head; so the Prophet told him that he should shave his head and offer fidyah as mentioned above.
In light of the above, you are allowed to wear an undergarment in ihram if you are suffering from an unbearable condition.