I think you can die in an act in service to an idea that you care more about than your life, and so it is still selfish in some sense.
Altruism is rooted in instinct. We see it in other animals, like the bird that calls out, drawing attention to itself as prey and increasing its chances of being eaten, to warn the flock. You're instinctually designed to do this because your tribe is presumed to carry many of the same genes that you do, and natural selection is actually about which genes survive, not which individuals do. So your instinctual altruism is throwing you the individual under the bus in service to your genes surviving in other individuals.
Is it selfless? If you're compelled by instinct to some kind of personally dangerous altruism, that doesn't actually seem like it's benefitting you personally. But I think every human that was compelled in this way would state that it's for selfish reasons. For example, the santa clause guy that run to the church to stop the mass shooter (this was in central texas I think). He would probably say that he just really cares about his neighbors and was willing to die to save them. Or to stand up to a thug. So even if it was ultimately instinctual, it's hard to see it being identified as purely selfless, at least in humans.