Yes, though the discrimination of homosexuals in this day and age is unacceptable, religious communities have the right to assert their own beliefs.
No, even religious communities are compelled to conform to the legislation of the nation in which they practice their faith.