1. be brave or determined enough to do something unpleasant
have the stomach for the fight
This expression has nothing to do with your stomach, unless you think of it in terms of anxiety or nervousness that manifests in your stomach. It's all about having the determination or perseverance to get through something difficult. Don't get this confused with 'can't stomach something', which means you can't stand or abide something, as if it makes you feel sick. If you 'don't have the stomach for something', it means you feel you don't have the skills or ability to do something. Usually, these expressions are used in relation to tasks that are unpleasant or morally questionable. You are more likely to hear this used in an informal context. Similar in meaning to 'having courage' (positive) or 'being yellow-bellied' (negative).
2. be unable to tolerate certain types of food
don't have the stomach for spicy food
In informal contexts, the expression 'to have the stomach for' or 'to stomach' can refer to your tolerance for particular types of food, such as spicy, fatty etc.