I used to do that with my QC15 first and then after it broke twice, with my QC25 replacement. Sleeping with them on is really tough on them, though. After the third replacement device, I decided I couldn't keep on doing it no matter how much I actually enjoyed putting it on at night and hear that soft static. The slight pressure actually felt pleasant.
Quitting using them for sleep was hard, though. I certainly felt the urge to buy a new pair but now I sleep with a pillow on my head if I'm sleeping on my side, or a puffier pillow put sideways under my head positioned in a way that it will cover my ears if I am sleeping on my back. It is no perfect replacement but I think the reason why I do that is because I am still seeking that QC20 feel.