Yes you can

You can wear a dress a skirt or nice pants to a wedding