Torture is defined in the dictionary as "the action or practice of inflicting severe pain on someone as a punishment or to force them to do or say something, or for the pleasure of the person inflicting the pain."
In a more official capacity, the United Nations Torture Convention of 1984 defines it as "[a]ny act by which severe pain or suffering, whether physical or mental, is intentionally inflicted on a person for such purposes as obtaining from him or a third person information or a confession, punishing him for an act he or a third person has committed or is suspected of having committed, or intimidating or coercing him or a third person, or for any reason based on discrimination of any kind, when such pain or suffering is inflicted by or at the instigation of or with the consent or acquiescence of a public official or other person acting in an official capacity."
Under the Mysterious Somebody, torture was more or less standard operating procedure by his police force, the DIS, but PPC agents today are forbidden from torturing anyone, be they Mary Sues or other agents. The former usually leads to a reprimand from the Flowers, while the latter tends to end with arrest and/or expulsion of someone from HQ. Several methods of execution count as torture, such as giving a Sue to Reavers or Redneck Trees, and are also forbidden.
OFUs teach through torture, but in their case, it is called "Learning through pain".