In the options for the Model S there are three possible codes:
TM0A - Alpha, pre-production, non-saleable
TM0B - Beta pre-production, non-saleable
TM0C - Pre-production saleable
From these codes, I would assume they can sell the production candidates, but they probably only sell them to insiders (employees or people close to the company in some way). Over time some of these might become available on the collector's market, probably at well above market rates for a used car. At least this is the case for very early examples of iconic cars.
I know Tesla displays the non-saleable cars at their facilities. I've heard there are a number of pre-production Model S and X at the Fremont factory in a display.