a. LeHalacha one should not daven in a place where it's considered putrid and disgusting when given a choice. Whether a child defecates or there's cow fertilizer and you smell it, the rule applies for both.
b. As an aside, Kaddish for the dead is a relatively recent innovation. In years past people would learn Torah to elevate the soul of who who departed. When more and more children unable to study became orphans some 300-400 years ago, a special Kaddish was instituted in place of learning (there's still the traditional "day of learning" today). See Rabbi Berel Wein's lecture on the Customs of Ashkenaz here. Not to say Kaddish Yasom shouldn't be said, but it's not Torah based and therefore should be approached as such, as emotionally distressing as it may be.
Hope this helps!