Usually they are set by the manufacturer, but it can be changed. Win2k lets you change it in Device Manager; I don't know about other OSs. The drive manufacturer may also provide a utility that does it.
You can update the
firmware (BIOS) of your drive to get around the region code. But these are usually hacked and may kill your drive just like a botched BIOS flash can kill your motherboard.