Any yarn will do however, wool and acrylic tend to work best.
Wool is an ideal fiber for carpets. Naturally warm, soft, very resilient and elastic. However, it is the more expensive option.
Acrylic yarn is the most like wool of all synthetic fibers; the fiber is very elastic, lightfast and heat-insulating. Cheaper than wool.