Each of these carries different risk, so it's worth separating them. Ice is the sneaky one: freezing preserves microbes rather than killing them, so ice made from unsafe tap water is exactly as risky as drinking it. In many bottled-water countries, commercial ice from licensed factories is actually made with purified water, and established restaurants use it, but street vendors and rural spots may not, so caution scales with the venue.
Brushing teeth sits in the judgment zone. In marginally safe places most residents and long-stayers brush with tap water without trouble since you swallow very little; in genuinely unsafe water areas, use bottled, it's a small cost for avoiding a bad week. Showering is fine almost everywhere as long as you avoid swallowing water.
Cooking depends on heat: water brought to a proper boil, for rice, soups, pasta, is safe regardless of source, which is why local cuisine in such countries leans on thoroughly cooked dishes.