Like bo5ton said, it varies by themes.
However, most of them are under a license which prohibits (either explicitly or implicitly) creating derived works and selling them. It's usually okay for your own personal use though, as long as the license allows it. (It falls under the same copyright laws as any other "derived" work for anything else covered by copyrights). I highly recommend that if you want to build them to sell them, you should build them from scratch. You can pretty easily build your own "vanilla" base template which you use and then extend that one for each of your new ones. In fact, just swapping the style sheets you could get an infinite number of very nice looking themes.
According to this, any theme for Wordpress is technically under the GPL license: http://wordpress.org/about/license/, however, like they say, it's a gray area. If you are going to derive from any of them, I highly recommend deriving it from one of the default themes (Twenty Eleven and Twenty Ten), since they have an explicit GPL license.