Of course, but a public transport is far from ideal for any mental work. Maybe read a book or listen to some music while commuting? I just can't imagine doing any serious work that is so noisy and moving etc.
Speak for yourself. Perhaps it's a knack you develop but I've been known to switch off from others for hours on trains. Some of my best work has been coding on long train journeys, especially if there's no wifi to interrupt.