There's an inherent, not necessarily unreasonable, assumption in this question that you can't kill outside the law and be 'good'.
Although one might suggest that is more a factor of the Law/Chaos Axis than the Good/Evil one... A Chaotic-Good Robinhood type taking down a cruel king would be explicitly acting outside of the law