Yes, Pillow will work just fine if you have enabled Aiplane mode during sleep.
Additional notes:
Please bear in mind that you need do disable Airplane mode at the end of the sleep session, if you want you data to be synchronized to other iOS devices that you own via iCloud.
If you use Pillow on the Apple Watch and you want to enable the sound recordings and/or alarm, you must *disable* Airplane mode on both your iPhone and Apple Watch to ensure that both devices can communicate.