I see nothing in the NEC that would prohibit the switch being face up in a countertop.
I agree with Trevor however I would check with an inspector especially if it is near a sink. He may use his judgement that the area around a sink is subject to moisture and water penetration.
Personally I think it is a bad idea. Buy an air switch --they make them for disposals exactly for this purpose
Have did the air switch app. many times.Also , have had request to use the same design to turn on pendant lighting above a work islaind on occasion.I agree with Dennis 100% here.
Safe, easy to install, just about $50 at Home Depot