Yep - you can declare any ball (except in a water hazard) you wish as “unplayable.” One-stroke penalty, and you are on your way.
I knew the rule, just never thought about taking it when on the green!