I'm using El Capitan, and this happens in Yosemite as well. Once a while I hear the notification sound, same as the sound when a new email arrive in Mail.app. But nowhere can I find where it comes from. There is no new email, or any red badge shows up in the icons in the dock or launch pad. And there is no new notification in the notification centre, and no alert appeared in the upper right corner of the screen. It appears nothing happened, except for the notification sound. How can I find what app generates it?
I seems that I use filters in GMail to skip inbox, and the sound is actually come from Mail.app. As a result, no new mail arrives to the Inbox of Mail.app, but to the Archive of the Mail.app.
In the preference of Mail.app, one option is to choose "Inbox Only" for "New message notifications". But it seems that this option will not mute the new messages sound when new message arrive to other mailbox, only skip the notification alert that shows up in the upper right corner of the screen.
If you are referring to the alert sound, then it is played whenever you click or do something that is not possible. Such as a keyboard shortcut that is not available in that application. The system-wide alert sound can be changed in the System Preferences-> Sound-> Sound Effects