The one possible exception I can think of is: a real prophet whose mind is not like mine, who knows the consequences of the self-sacrifice, and whose purpose is for human benefit.
Personally, I don't believe in prophets of any kind, yet I can see a situation of sacrificing one's life. If my wife and kids were at life risk from a home invader, and I absolutely knew my life would save theirs, then it is duty. I think many folks would agree.