Yes. Caffeine can act as a laxative and increase muscle contractions that propel food through the digestive system. The effects can kick in quickly and for this reason, some people drink coffee in the morning to assist with bowel regulation.
Whilst most athletes welcome their pre- training or pre-race toilet trip, excessive caffeine consumption of any kind may lead to diarrhoea so don't go over the top. As always, be sensible and remember electrolyte-rich drinks will help replenish anything you may lose during this trip.