Although there is no hard data available, the fact is that a closed course environment is by nature safer.
In addition that one has to compare situations. If the rider is riding agressivly on - say the "twisties" it is signficantly more dangerous than taking greater risk on the track. If riders ride at a safe pace on the street and on the track, the track is even safer - as the chances of a severe injury or death at sane street speeds is virtually nil.
A good example is the Jarama Race track in madrid. Opened in 1968. Lost it's homologacion for national races a few years ago due to lack of safety upgrades. There has been, perhaps millions of motorcycle miles - race, trackdays, schools (of all sorts) and not one single motorcycle death in 40 years.