On Viscosity Solutions of Certain Hamilton–Jacobi Equations: Regularity Results and Generalized Sard's Theorems