If I wanted a green card, instead of marrying a woman can I do a same-sex marriage with a friend, just on paper. Not that we do anything but to government we are married so one of the party can get green card. Is that allowed?

That would not be permissible because you would be supporting homosexuality, and you would be contributing in normalizing it (even if it’s a very small contribution). So it’s not permissible.