I’m sure many of us will agree that Captain Kirk violated the Prime Directive in (just about) every episode. In A Taste of Armageddon, he directly interfered with two warring planets – Eminiar VII and Vendikar – once the landing party was chosen as casualties of their war. Kirk’s violation here saved not only his crew, but the two planets and brought in a Federation negotiator.
Captain Picard had the most obedience and respect for the Prime Directive, but still managed to get himself into trouble with it on more than one occasion. Most notably would be First Contact. This interference was necessary, but still a violation that’s plain as day. Without human’s first contact with Vulcans, there wouldn’t have been a future to look forward to or a Prime Directive in the first place. Do we even need to mention Captain Sisko here?
As the leader, if you need to alter a rule, and can do it, then do it. Refusing to give in could hinder your operations and those (lives) of your crew/team. There are always exceptions to a rule as there were to the Prime Directive. Check Memory-Alpha for exceptions.
“A starship captain’s most solemn oath is that he will give his life, even his entire crew, rather than violate the Prime Directive.” ~James T. Kirk, 2268 “The Omega Glory”