The validity of classical nucleation theory and its application to dislocation nucleation