Doctrine was the term that described the teachings or principles of law established through past decisions that form the fundamental core beliefs of a government or religious body. Dogma was a rigidly upheld and unquestionable belief. The term originally referred to religious beliefs, but was often used figuratively to describe values held too rigidly, especially commonly Federation values, by those that didn't agree with their values.
In 2151, Captain Jonathan Archer made the decision to withhold the cure to a deadly plague on the planet Valakis, realizing that it would be irresponsible of his crew to interfere with another species' development. He noted that until somebody came up with an official doctrine he would have to remind himself every day that he "didn't come out here to play God." (ENT: "Dear Doctor")
Two years later, upon learning about the Triannon religious beliefs from Pri'Nam D'Jamat and his crew, Captain Archer stated that he disagreed with any doctrine where those who disbelieved were punished by death. (ENT: "Chosen Realm")
In late-2154, Lieutenant Malcolm Reed noted that during their mission to locate the Xindi in the Delphic Expanse, Enterprise NX-01 had lost twenty three men and women which was outside of the traditional military doctrine of twenty percent casualties. Commander T'Pol countered his statement with the Vulcan axiom, "the needs of the many outweigh the needs of the few", explaining that those deaths were honorable ones. (ENT: "The Council")
After creating the android Lal in 2366, Lieutenant Commander Data scanned all of the available literature on parenting, noting that one traditional doctrine insisted "spare the rod and spoil the child", suggesting if a child was not physically punished when they had done something wrong that their development may suffer. (TNG: "The Offspring")
After Benjamin Sisko told him that all he was interested in was gaining the advantage, Dukat retorted "Now, don't go spouting off your holier-than-thou Federation fair-play dogma". (DS9: "The Maquis, Part I")
Several weeks later, Elim Garak told Julian Bashir that he was "a prisoner of Federation dogma and Human prejudice". Bashir had told the Cardassian of his dislike for "The Never Ending Sacrifice". (DS9: "The Wire")
In 2373, while reviewing the Federation's cultural database Captain Kathryn Janeway hypothesised that most religious doctrines had a scientific basis "if you scratched hard enough." (VOY: "Sacred Ground")