Is it a feasable method to join the military, so that once a war breaks out you can die in the war, while not feeling like a useless fuckup, because you were actually dying for a cause?
If it is a cause you agree with, then yes, it is feasible.
I'm struggling with this post, though, which is a reflection of me, not of you. I'm filtering what you say through my own experiences, learning, and values in order to process it. It may be of no value to you, but since you are seeking input, this is what I work out and offer to you to work with or reject as you choose.
My first thought was of the Stoics' five rational reasons for withdrawing from life, and the analogy for life is a party:
The Stoics likened life to a party, and determined there were five reasons to rationally exit the party (suicide):
1. In service of one's country, i.e., an old friend shows up to the party and requires your services.
2. The arrival of rowdy revelers, i.e., tyrants who force us against our will to say or do disgraceful things at the party.
3. Protracted illness that prevents the soul from the use of its tool, the body, i.e., spoilage of provisions for the party.
4. Poverty, i.e., scarceness of party provisions.
5. Madness, i.e., drunkenness at the party. In Buddhist terms, intoxicants lower one's inhibitions against doing no harm to others and, by default, to the self. In Stoic terms, this equates to lowering the inhibitions put in place by practicing virtue. According to Epictetus, the purpose of practicing virtue is for life to flow more smoothly, and as social animals, virtues directly impact our interactions with others. This agrees with the purpose of the Five Precepts of Buddhism, considered gifts to others for the good of social order (no killing, no stealing, no lying, no sexual misconduct, no intoxicants).
Source: Griffin, Miriam. "Philosophy, Cato, and Roman Suicide I," Greece and Rome, vol. 33, no. 1, 1986, pp. 64-77. Original source cited by Griffin, Stoicorum Veterum Fragmenta, a 1903-1905 collection by Hans von Arnim of fragments and testimony of the earlier Stoics. The Buddhist/Stoic commentary under madness is mine.
The source article and article II by Griffin are available for free online viewing at JSTOR.
What catches me up here is that you are already wanting to withdraw from life, and so I wonder if any of the latter four reasons apply as rational reasons for wanting to withdraw because they make the party unsustainable. They are dealt by Fortune, and put such an irreparable, unpluggable hole in the boat of your life that you seek to swim away from it toward the refuge of freedom from life.
The first reason, in service of your old friend, your country, does not seem to fit in your situation, because it's not showing up at the party and asking you to leave, that is, to sacrifice your life in support of the one who has supported you. You are already wanting to die, and showing up to them to give purpose and meaning to your life, your choice, and your death. You can do that, but I think it requires in-depth consideration to ensure it is the best choice.
I know from your other post in Off Topic that you believe the military is necessary and undervalued by your country's government, and have a passionate response to that, perhaps even feel a calling. But in the context of this thread, it seems to me that you are seeking meaning and purpose for your choice, an excuse for it or an external validation, and are considering giving responsibility, control, and power to your country's military to enact your suicide for you, which may or may not be their goal as well.
As others have pointed out, there are lots of elements beyond your control if you pursue this course, and you may not want what you are required to do, such as killing others; or you may not see combat and have your life go on indefinitely, stuck under the control of the military; or you may end up not wanting to die in the way required; or you may not be allowed to die.
It seems to me that you're handing over a lot to your country's military instead of taking self-ownership and self-determination for your own wants and choices. It feels like co-dependence, that is, offering control to another, which will quite possibly, even perhaps likely, end up in resentment due to feelings of disempowerment because of the necessary loss of choice, self-determination, and self-control. To truly sacrifice yourself to the military means you sacrifice your lived life, whether or not it ends in a total and complete sacrifice of your life through death.
I have been in the US military. Once the military owns you, your are property, chattel, a tool. You may or may not love the military, but it will not love you; it loves its own interests, which you will exist only to serve. It loves power, victory, and domination. Yes, it is meant to protect, but it also wants more; it has power, and it wants power, which means it will always focus on violence and oppression, including of its own members if they do not completely agree.
You may find comradeship and love and meaning among fellow members, but the military itself will only provide that through them as a means for you to agree and comply with its wishes; if you don't agree or comply, it will not care, and it will have the power to do to you and with you as it chooses. If you want to hand your total life over to them, whether it results in death or a life they own, then the military is perhaps a good choice for you. If you have any reservations about that, if your ideas of heroism are romantic rather than realistic, or if you want to make and ensure the success of your own choice to die, then I would from my heart and experience suggest you thoughtfully reconsider.