Bananas are a good source of fiber and potassium, which can help firm up your dog's stool and alleviate diarrhea. Additionally, bananas are gentle on the stomach and easily digestible, making them a suitable option for dogs with gastrointestinal upset. You can offer your dog small pieces of ripe banana as a treat or mix mashed banana with their regular food. However, as with any dietary changes, introduce bananas gradually and monitor your dog's response.