If a Android device is turned off, does the alarm sound? If a alarm is set and a Android device gets turned off (for whatever reason), does the alarm still sound?

I want to generically refer to Android (latest version if it makes any difference) and we are talking about stock Android
It depends on the phone and on the alarm app. Some offer this specific function in case your phone does not wake automatically. Some other offer a scheduled wake to turn your phone on just before your alarm has to ring.

Anyway, if you put your phone into airplane mode, it is much like turning it off: provided background apps are closed, all your phone is gonna do is wait for the alarm to ring. It will not send or receive data (for those who don't like waves near them all night when they sleep), and it is gonna leave your battery level near untouched.