I don't think legally but more politically and PR wise. There a difference between firing someone for making donations to pro-X groups and firing someone for being X. In this hypothetical scenario, Eich would have to prove he was fired for being gay instead of for making a public donation that support a group and leads to potential blowback against the company. It's bad either way. Mozilla had a no win situation here. They got bad PR from both sides.