Samson's destruction of the Philistine temple of Dagon was not intended as an act of suicide. Although Samson might reasonably have foreseen his own death as a result of his action, his primary intent—as seen from the prayer he uttered at the time—was to return to the mission God gave him.
If a brave firefighter were to sacrifice his life to save a small child, we would not see that as an act of suicide. For that matter, we would not see the life of Jesus as an act of suicide, even though he might clearly have foreseen that he would be crucified.
The Church's prohibition on suicide is a statement on the value of human life. Those who die while affirming or protecting human life are not guilty of suicide.