In 2009, Slate’s Explainer asked and answered: “When did getting “hit by a bus” become the standard image of unexpected catastrophe?”
They credit Joseph Conrad, more specifically his protagonist (of sorts), Mr. Verloc, with the earliest accident-related usage:
But just try to understand that it was a pure accident; as much an accident as if he had been run over by a ‘bus while crossing the street.
Of course, if the assertion’s accurate, it certainly took a long time for the two meanings to, um, collide. “Buses” – at least those capable of running people over – apparently started careening around as early as the 1600s.