This topic has come up frequently lately -- can you use a yarn different than what is called for in the pattern? Yes, you can, but there are some caveats.
First, does the yarn the designer used contribute significantly to the piece? For example, if the piece is to be felted, you'll need to use natural animal fibers -- plant fibers and man-made materials won't felt, so you won't get the same result. Some pieces are designed around a specific yarn, using the yarn's natural tendency to drape or hold its shape, or some other qualities. Slubs, bumps, variance in yarn thickness, etc., will all impact the ability of the yarn to slide against itself and affects the stretchiness of the piece. The number of plies and the tightness of the twist affects the texture and sheen of the finished knit piece. The stitch pattern itself may be a factor -- complicated stitch patterns are best shown off with smooth yarns and get lost in textured yarns. So you'll want to consider the specific qualities of the yarn when choosing a substitute.
Second, does the pattern have a specific gauge, or does it say the gauge isn't critical? If you're knitting a scarf or an afghan, it may not matter too much if the end result is off an inch or two. But if you're knitting a sweater or other sized piece, that inch or two will make the difference between a cherished item and a thrift store donation.
Gauge tells you how many stitches it takes to knit 4" wide and how many rows it takes to knit 4" long. If the pattern gives a gauge, you'll want to match it, even if you used the identical yarn the designer used. With needle knitting, you can knit up a swatch with your substitute yarn and determine if the gauge matches or not. If not, you switch needles to a larger or smaller size, and knit up another swatch, and so on until you find the yarn/needle combination to match the measurements the designer specified. Needle knitting patterns give needle size as a guideline; the knitter must select the appropriate size needles to match the gauge.
To date, loom knitting patterns are generally designed for a specific loom (such as the KKs). It is more difficult, and spendy, to switch looms to try to match gauge. Chances are, you'll get too large a gauge with one loom, and too small a gauge with another loom, or the peg count will be off. You do have the option of trying to knit with a little more tension or a little less tension than you normally do. You could also adjust the pattern by adding or subtracting stitches in each row and changing the number of rows to get the same finished measurements.
For loom knitters, the remaining option is to find yarn that is as close as possible to the same dimensions as the yarn the designer used. Generally, it is the diameter of the yarn that you're trying to match up. Compare labels (the designer should include label info in the pattern) for weight and length of the skein -- calculate ratios and see how closely the yarns match up. If you can, compare wraps per inch (wrap each yarn around a pencil, and see how many wraps it takes to cover one inch) -- they should match up pretty closely. Even so, before you commit to your substitute yarn, knit up a swatch and verify you'll get the gauge you need to get the results you want.