Daniel Engber in Slate: "Test-Tube Piggies: How did the guinea pig become a symbol of science?"
The guinea pig's celebrity (and infamy) dates to the late 1800s and the sundry reputations of the early germ theorists. One by one, the major diseases of the time were reduced to their bacterial causes. Robert Koch, a country doctor working out of his cottage in Wollstein, Germany, identified the agents responsible for anthrax, cholera, and staphylococcus. He began by swapping sera from field mice, rabbits, monkeys, and guinea pigs, but the latter proved especially apt. Bred as a food source, guinea pigs were gentle, quiet, unperturbed by cages, andby a fortunate coincidence, perhapsprone to infectious disease. (You can give a Cavy full-blown tuberculosis with a single Mycobacterium tuberculosis, says TB researcher David McMurray.*) By the time he was named to a prestigious professorship in Berlin, Koch was using guinea pigs by the armful.
Sewall Wright became well-known for doing his genetic experiments with guinea pigs, in contrast to others who used much faster-reproducing Drosophila. Jim Crow used to tell the story about how Wright once absent-mindedly used a guinea pig as a chalkboard eraser, but I'm sure he never witnessed this; it was a well-known story.