Understanding the purpose of underwear
The unconscious likes to speak to us in a coded message, so lets first understand why we need underwear.
Underwear protects the body from the environment; clean and protection. It preserves modesty, by keeping the body covered in socially and morally acceptable forms.
Underwear Islamic dream meaning
According to Ibn Sirin he interprets underwear in a dream being related to ones chastity; also known as purity, is a virtue related to temperance.
I can see why he connected underwear with chastity because of its hidden private nature. Underwear in a dream might contain a sexual undertone.
But to those who dream of white underwear points to a pure mind or not deviant in anyway. Dirty underwear might mean the opposite.
About underwear dreams in Islam
Underwear in Islamic dreams represents what you are hiding; sexual feelings, urges, or dirty behaviors that are repressed.
This is why so often we either dream of dirty or white underwear — dirty or a clean mind related to sexual behaviors.
If you are found buying underwear in your dream represents changing your behaviours and urges; starting a new leaf in this department.