It might not be illegal, but you have to realize you've labeled yourself as a pain in the ass, or someone willing to irritate and cause problems for a company, thus this will probably affect your ability to be promoted, or work on important projects / teams.
Everyone can respond how it is legal, their right, etc, but the fact that you are now known as a troublemaker won't bode well for you.
Everyone can respond how it is legal, their right, etc, but the fact that you are now known as a troublemaker won't bode well for you.