I would say yes, especially on long car rides and in other situations where a bathroom may not be readily available (or a bathroom may be completely unavailable).
That being said, it is a very good idea to work on toilet training them whenever possible, especially at home and in familiar locations like relatives and friends houses in order to get them used to the idea of using the toilet whenever they can.