In OSX is it possible to set a preference for a program for whether it fully quits or stays running in the dock on closure of the last window? e.g. Netbeans for MAC defaults to completely quitting, so it's possible for a program to internally set this preference. Is it possible for the user to alter the preference in general?
There isn't a general preference that says to the applications if they should quit when their last window is closed, or if they should stay open; that behavior is hard coded in their code.
A general setting would not make sense, as the behavior depends from the type of application. Apple has guidelines about this.
While saying to a document-based application to quit when the last window is closed would make sense, it would probably make less sense to say to an application like the preference panel to stay open when its window is closed.