"I was only obeying orders" so you will get a first class defence before being found guilty or will they pay your salary while in prison?
What about killing someone in the course of military action which is subsequently declared an illegal act? Eg an invasion of a sovereign territory by another state.