Well, there are several possibilities, nobody knows the exact truth. Some say that the animals were named after their selling price, because sailors at the time would sell them for one Guinea, a British coin. This theory has proven untrue, because they were named before the coins existed. Pigs certainly don’t come from Guinea, but they might have been imported through there. The word "Guinea" was also frequently used to refer to exotic locations far away in the years that they appeared overseas. The word “Guinea” can also be corrupted from the word “Guiana”, which is close to their point of origin, South America.
The word pig probably came from the fact that they make little pig like noises sometimes and they also look like a mini piglet.
In Germany, they are called “Meerschweinchen” which means “little pig from the sea”. The French word “Cochon d’Inde” means “pig from India”. It all refers to the fact that they were brought into the country by the sea.