Yes, as of 2013, when the U.S. Supreme Court overturned a piece of federal law called the Defense of Marriage Act (DOMA), same-sex marriages are treated like any other marriage for federal immigration law purposes. But you will still need to make sure that gay marriage is legally recognized in the state or country where it took place. This should not be a problem, since the supreme court ruled in Obergefell v. Hodges that no state may ban same-sex marriage. You will need to present a government-issued certificate of your marriage as part of the immigrant's application for U.S. lawful permanent residence (a green card).