The iPod touch and iPhone are designed so that only software apple makes and puts on the iPod will work. This is done by not allowing the user full access to the operating system. When an iPod touch or iPhone is jailbroken the user gains full access to the operating system so they can basically do whatever they want. For example, you can install new programs (NES emulator, chat programs, etc.)
Unlocking is a completely different subject and the iPod touch can't be unlocked. Cell phones are normally sold locked to a service provider. That means phones that say verizon on them will only work with verizon service, ATT phones only works with ATT service. When a phone is "unlocked" it can be used with any service that uses the technology supported by the phone. For example, I buy a phone from ATT (which uses a GSM signal) and when my contract runs out I decide T-Mobile (who also uses GSM) has a better service plan but I love my ATT phone and don't want to get a new one. I would have to unlock my ATT phone to allow it to use a sim card from T-Mobile.
There are a few ways to get an unlocked phone. Under certain conditions the service provider will unlock it for you. You can buy phones already unlocked. You can unlock them with a computer program. Currently, ATT won't unlock iPhones in America (you can get unlocked iPhones in europe, because of the laws in some countries, but they're really expensive). To get around this some programmers have figured out how to unlock the iPhone. There are paid and free ways of unlocking your iPhone both of which work almost the same I believe.