"two-wheeled, two-person, one-horse cab or carriage with the driver's seat above and behind," 1847, from James A. Hansom (1803-1882), English architect who designed such a vehicle c. 1834. The surname is from 17c., originally a nickname, handsome.
The fashionable form of the cab. The original design placed the driver at the side. The popular form was a type "with two big wheels, of very uncertain equilibrium and dangerous character, in which the driver was perched in a dicky placed high up at the back of the vehicle and took his instructions through a small trap-door in the roof. It was difficult to enter a hansom without soiling one's clothes." [Encyclopedia Britannica, 1929]