|The unpleasantness of some chalkboard sounds has to do with their frequencies.|
Higher processing levels of the auditory system may contribute to the sensation of discomfort due the lack of phase locking (mechanisms that your ears and brain use to localize sounds in space using cues from both ears) and reduced selectivity at high frequencies. There may be evolutionary aspects, since these annoying sounds resemble screaming. If there’s something that’s going to make your evolutionary ancestors bolt, after all, it’s a scream.
However, people tend to be fine with high frequency sounds with constant intensity and low variations in the frequency components. A good example of this is violin harmonics or the piccolo. The sounds that make us go crazy tend to vary a lot, fluctuating between low frequency components and high frequency components (nail sliding down the chalkboard does this). Every person responds differently, so that's an evidence for higher auditory processing contributing to the discomfort.
While it is true that at the cochlear level, 4k range is the most amplified by resonance. But the amplitude of the annoying chalkboard sound is nowhere close to the "feeling threshold" where hair cells can get killed after a short exposure to the sound. So even though the sound is annoying, your eardrums are perfectly safe.
Historically, sound has also been used as a torture method. An article in the Journal of the Society for American Music describes how music was frequently used in interrogations in Iraq and Afghanistan to obtain information in lieu of physical force.
The top picks for this task? Bruce Springsteen’s “Born in the USA;” Christina Aguilera’s “Dirrty;” Nancy Sinatra’s “These Boots Were Made for Walking;” AC/DC’s “Shoot to Thrill” and Hells Bells;” and Barney the Dinosaur’s “I Love You.”