Nobody knows exactly where the Koi we have today originated, but it is common belief that the common carp (Cyprinus Carpio) originated somewhere near Persia and western Asia. The common carp migrated into China either through trade or natural waterways. It is not known when exactly when the carp were introduced into Japan, but it is believed to have been through trade.
The common carp is an excellent source of protein, so the rice farmers in the Niigata Prefecture started keeping them as a food staple for the long winter months. When the carp (Magoi) would reach 6 inches long, the rice farmers would catch and salt them so they would last the long winter months.
Around the mid-1800's, some of the rice farmers started noticing that some of the carp were mutating. Blotches of red and white were appearing on them. They decided that it would be cool to keep those ones out and breed them. Pretty soon they had developed distinct patterns. It is amazing that these simple rice farmers were selectively breeding the carp to bring out amazing colors and patterns, when at the same time, the only genetic research going on was Gregor Mendel's experiments with pea plants.
At the turn of the 20th century, Koi were crossbred with the scaless and mirror carp from Germany. The Koi Breeders called the new varieties, Doitsu (the Japanese word for German).
Koi keeping took off in Japan when, in 1914, some breeders took samples of different varieties to an exposition in Tokyo. People from all over Japan saw the "Living Jewels". Over the next few decades, dozens of new varieties appeared. The next big leap in Koi keeping was the creation of plastic bags in the 1960's. Koi could be shipped all over the world reliably and without high loss.
Today, Koi are bred throughout the world, but most people agree that the best ones come right from the Niigata Prefecture in Japan. Koi are one of the most sought after ornamental fish in the world. You can find Koi hobbyists in nearly every country.