This article by Rabbi Yosef Melamed of Denver Kollel answers your question:
The Shulchan Aruch (Orach Chaim 89:54) rules that someone who is hungry or thirsty may eat or drink before davening.
Mishna Berura qualifies this ruling as referring to one who is very hungry
or very thirsty (Mishna Berura ibid.:25). The source of this halacha is the