Like others have said in this thread, it depends on the circumstances.
In addition to that, I would say that the way I think of my own anarchism means that I don't hold myself to strict standards because I'm not trying to build an anarchy, but more anarchists. By that, I mean that in practice, the world is quite far off from being an anarchist world and that if I were to adhere to dogmatic principles, I wouldn't make much progress.
It's a lot less drastic than fighting in the military, but an example of one of the compromises I make is that I have done some activism at the local level regarding access to health and social care services (including accessible housing). I don't necessarily think that these functions are best fulfilled by the state, but also, I can't envision a world without the state (in this domain at least). But also, I don't feel bad about my failure of imagination, because anarchism, for me, is about letting go of grand narratives about myself and the world, recognising that I am such a tiny part of the bigger picture and that I can't do this alone. Along those lines, it's a pragmatic choice to push for better socialised services, even if that means enlarging the state, because it'll help give voices to people who I want to have a say in the world.
It doesn't feel like a compromising of my principles, but a more genuine way of honouring them. Something I like about anarchism is that it's messy, and it's a process. As a framework, it's helped me to grow a lot, and I feel like I need to be open to situations that challenge my principles because I know I'm a better anarchist now than I was a year ago, and dogmatically sticking to certain rules or principles would feel like I have decided I am currently the best I'll ever be. So even though I don't like the thought of it, I need to be open to the principle of having to fight, if it were necessary, as well as possible needing to resist fighting (like Israelis who would rather be imprisoned than be complicit).