Names of objects are either feminine or masculine. The gender has nothing to do with the function of the things. In addition, the possessive adjectives agree with the owner if it's 1st, 2nd or 3rd person singular/plural. But the gender of the possessive adjective matches the gender of the possessed thing. Because of this, it's "meu vestido", not "minha vestido". Anyway, men can have dresses. There's no law that prohibits this.