On jailbroken iPhones, you can do it by installing a tweak called BlowToUnlock, which, as its name indicates, allows you to wake up your phone (not unlock it, though, if you have set it to require a passphrase or fingerprint to be unlocked) by blowing air into the primary microphone.
I once used it on an iPhone 4 running iOS 7.x, and it was fun to use for a while. In more recent iPhones, I believe you can "OK Siri" your way to the lockscreen, too.
I suppose a rooted Android phone can allow a developer to use the audio input APIs to do the same, and maybe it already exists, but I doubt it's possible on a non-rooted phone.
EDIT: Nougat lets you use the "OK Google" phrase to unlock your phone, but first you have to wake the screen with the Power or Home button.