Yes, you can wear prescription sunglasses while driving, but it is important to ensure that you are able to see and be seen while driving safely.
For instance, your prescription sunglasses should meet the ANSI Z87.1 standard for sunglasses, which includes requirements for lens color, shade, and clarity. This will help ensure that your glasses meet certain safety standards and can help improve your vision while driving. As an alternative, you can also choose polarized lens or photochromic lens for your eyeglasses.