We calculate the two-photon absorption in bulk and single layer hexagonal boron nitride (hBN) both by an ab-initio real-time Bethe-Salpeter approach and by a the real-space solution of the excitonic problem in tight-binding formalism. The two-photon absorption obeys different selection rules from those governing linear optics and therefore provides complementary information on the electronic excitations of hBN. Combining the results from the simulations with a symmetry analysis we show that two-photon absorption is able to probe the lowest energy 1s states in the single layer hBN and the lowest dark degenerate dark states of bulk hBN. This deviation from the "usual" selection rules based on the continuous hydrogenic model is explained within a simple model that accounts for the crystalline symmetry. The same model can be applied to other two-dimensional materials with the same point-group symmetry, such as the transition metal chalcogenides. We also discuss the selection rules related to the inversion symmetry of the bulk layer stacking.