Quick answer: You can, it's harmless, but there's no point. Once the lights are out and the room is dark, there's no blue light to block. Wear amber glasses in the hour or two before bed, then take them off, and use an eye mask if you want full darkness while you sleep.
Why it doesn't help
- Darkness means there's no blue light reaching your eyes to filter
- Lenses can press or shift uncomfortably against a pillow
- An eye mask blocks all light far better than glasses
The better routine
Put amber glasses on a couple of hours before bed while you're still on screens or under lights, then take them off at lights-out. Keep the bedroom dark (blackout curtains or an eye mask) and that does the rest.
The bottom line: Sleeping in blue light glasses is harmless but useless, the work happens before lights-out. Wear them in the wind-down hours, then let a dark room or eye mask take over.