Yes this can be underwear rash. There is another possibility that when you walk, the sides of the any underwear become wet due to sweat and when this sweat become dry, these sides become hard and hurt the thighs leading to contact allergy. Apply hydrocortisone cream twice daily and take anti allergy medicines or visit to doctor.
There is the possibility of an allergy to latex. Latex is used in elastic, such as the elastic bands on under garments. If that is the case avoid anything that contains latex.