As far as I know, only animal-based fibers will felt properly. At least in the way we're used to doing it. Wool, mohair, alpaca, ... beaver, muskox, possum... you get the idea. (Technically what we call "felting" is properly called "fulling" but that's another discussion.)
The way it works is, the hair (fiber) has a hollow shaft that has microscopic scales on the outside, which make it flexible. When you add heat, the scales flex open (presumably to act like tiny radiator fins to keep the animal cool when the fiber is still on the animal). Add moisture to lubricate the process and agitation to stir things up and the fibers get entangled in the scales of the other fibers and the whole thing becomes a tangled hairy mess. Then when you cool it, the scales close, locking everything into place.
Plant and synthetic fibers don't have this property, so this technique doesn't work with them. You could conceivably use them for needle felting I guess, though I don't know enough about how that works to say for sure.
Other "gotchas" about felting (learned the hard way):
If you're doing it in the washer, don't let the machine go into the spin cycle. For one thing, you may create creases in the fabric that will NEVER come out. But also, many washers always rinse with cold water, and you don't want this to happen just yet. You can leave the lid open when you start the machine, which SHOULD keep it from going into the spin cycle. (You can probably guess from this that you can't use a a front-loading washer...)
If possible, don't try to felt white or light colored yarns. A lot of them use bleach to prep them for the dyeing process, which interferes with the way the felting works. SOME yarns won't have this problem. If the yarn is undyed, you may not have to worry about it. and you can always try a swatch and see if it's going to work for you. And you can probably guess that you don't want to use bleach in the wash when you do this, though a SMALL(!) amount of detergent can actually help.
The looser you knit, the better. In fact, I use at least a size or two larger than usual needles. The looser the knit, the easier it is for the fibers to move around and do what they do.
Put the piece you're felting in a pillowcase or some other kind of cloth bag that WILL STAY SHUT. Otherwise, you may wind up choking your washer with loose fibers, and you'll almost definitely get whatever happens to be floating around in the wash felted into your work. (Cat hair is especially obnoxious for this.) DON'T use one of those mesh lingerie bags, they don't do the job you're trying to do.
If the yarn says "superwash" on it, it won't felt. Or at least not well. Whatever they do to yarn to give it its "superwash" qualities is designed to KEEP it from felting, so you're working at cross purposes.