Step 1: Understanding the Concept
A Bronsted base accepts \( \text{H}^+ \) from water and gives \( \text{OH}^- \).
Step 2: Test Ammonia
\( \text{NH}_3+\text{H}_2\text{O}\rightleftharpoons\text{NH}_4^++\text{OH}^- \)
Step 3: Check the Others
\( \text{CH}_3\text{COOH} \), \( \text{H}_2\text{C}_2\text{O}_4 \) and \( \text{HCl} \) donate protons to water, so they are acids.
Step 4: Compare the options
Option (D) is correct.
Final Answer:
Ammonia acts as a base when reacted with water.
\[ \boxed{\text{(D) }\text{NH}_3} \]