Refusing a research project and/or assignment because of personal convictions Is there a general rule about what a postdoc or graduate student can or cannot refuse to do because of personal convictions?

I assume that there must be institution-specific rules, but also maybe legally defined limits? I know that (fortunately!) in most countries, a supervisor cannot "force" a student or postdoc to do something that goes against their religious convictions, for example, but there can be grey areas that are not as protected as religious belief; what about personal opinions and life choices? 

For example, I am wondering if personal convictions are a valid and protected reason to refuse:


Experimenting on animals
Applying for defense/military funding (e.g. DARPA)
Collaborating with companies with discutable ethics
Working on any type of dual use research
Conducting experiments that generate significant amounts of pollution


Most of the time this kind of ethics dilemma can be avoided by carefully choosing a laboratory. But not always - money can be tight, reviewers can ask for animal validations after submission... So I am wondering if there is a rule of thumb for determining what is a "reasonable" reason to refuse an academic project based on moral arguments.
Standard IANAL disclaimer (I’m speaking from anecdotal experience and could be very wrong).

I had a student who recently refused to work on a political dataset because of her political views. I could’ve told her that this was a material part of our work and she has to do it or I can’t advise her. I don’t think there would’ve been any repercussions to me if I did. Generally speaking, if an advisor doesn’t want a student the reasons why aren’t very relevant, it’s best to part ways.

Eventually I chose not to and assigned her to another project. Did her academic progress suffer as a result? Sure. She made a choice and is paying some price for it.

For funding/collaboration, I can hardly see what legal protections could exist. If you choose not to apply for a DARPA grant or work with anyone there, you can’t reasonably argue any grievance as a result. Say, if you’re up for tenure, saying that you didn’t secure any funding but that’s only because you refuse to work with DARPA sounds preposterous. 

A similar case goes for boycott movements (e.g. BDS). My field (computer science) has a very strong Israeli presence; if you’re a BDS supporter it may limit your future academic  prospects. No one can force you to collaborate with Israelis, but in some cases, it may become very difficult. 

In the end, nothing in life is free, and you need to decide how important are your personal convictions vs the price of following them.