There is no simple answer, since it will always depend on the context. However, in most cases, it would go agains the first precept: to abstain from killing.
However, there could be situations where the act is interpreted in different contexts. Thich Nhat Hanh once wrote (a few years after the incident in the picture):
The Vietnamese monk, by burning himself, says with all his strength
and determination that he can endure the greatest of suffering to
protect his people. What he really aims at is the expression of his
will and determination, not death. To express will by burning oneself,
therefore, is not to commit an act of destruction but to perform an
act of construction, that is to suffer and to die for the sake of
one’s people.
In a more recent interview (with Oprah Winfrey), Thich Nhat Hanh mentioned that there were a lot of killings (by the government of its citizens) in the country at the time, and that the monk that chose this action saw it as a peaceful action to put an end to the violence (protesting with a non-violent action to create attention, instead of violence that would cause more violence). In other words, the action to save many lives was an act of compassion.
From Wikipedia regarding sacrificing the body:
The act of sacrificing one's own body, though not by fire, is a
component of two well-known stories found in the ancient Buddhist text
known as the Jataka tales, which, according to Buddhist tradition,
gives accounts of past incarnations of the Buddha. In the "Hungry
Tigress" Jataka, Prince Sattva looked down from a cliff and saw a
starving tigress that was going to eat her newborn cubs, and
compassionately sacrificed his body in order to feed the tigers and
spare their lives. In the "Sibi Jataka", King Śibi or Shibi was
renowned for unselfishness, and the gods Śakra and Vishvakarman tested
him by transforming into a hawk and a dove. The dove fell on the
king's lap while trying to escape the hawk, and sought refuge. Rather
than surrender the dove, Śibi offered his own flesh equivalent in
weight to the dove, and the hawk agreed. They had rigged the balance
scale, and King Śibi continued cutting off his flesh until half his
body was gone, when the gods revealed themselves, restored his body,
and blessed him.
A much discussed topic, and the answer is that it depends on the context.