"i go to work by subway" is corrct because the preposition 'by' means via or in means of using something. the preposition 'on' means you are in the bus already and wouldn't make sense to tell someone that you are in the subway at work.
"they go to school by bus." is corrcet because again the subject pronoun, they, needs to get to school not 'on' a bus but 'by' means of using a bus. the preposition 'on' in this case means that the the subject pronoun 'they' are already inside the bus.