Yes, women can wear pants or jeans under a longer dress or shirt, as long as the outfit as a whole observes the guidelines of modesty set by Islamic law, which includes covering the body properly and not accentuating the shape of the body.