Sheikh Ahmad Kutty, a senior lecturer and Islamic scholar at the Islamic Institute of Toronto, Ontario, Canada, states: Generally speaking, it is not permissible for males to wear any sewn clothes and therefore it would be a breach of the rules of ihram to wear underwear. However, if someone has a specific medical condition that necessitates wearing underwear, then it would be considered as permissible in lieu of necessity.
If it is simply due to his concern of exposing one’s `awrah, it is possible to guard against this possibility by wearing belts or pins to keep the two pieces of ihram as tight and firm as possible so that they do not come off easily.
If, however, someone wears sewn clothes such as underwear without any genuine excuse, then he has violated the conditions of ihram. He must therefore offer a compensation by offering a sacrifice, feeding six persons, or fasting three days).