
Nobody is keeping you from learning the file format on your own, and I'm sure there are at least some sources of information on it on the web, but it is quite complicated, and takes a lot of processing power to uncompress, so I wouldn't recommend it.
However, I think that if you were to use JPEG files in a commercial game you would stand to get sued for copyright infringment or something. But nobody is gonna sue you if it's just to learn (which I think it is).