You cannot delete a default theme or a theme shared to you from the organization, a parent course, or department.
You are prompted to choose a replacement theme for the navbars using the theme you want to delete. If a theme with an identical layout does not exist, you are not allowed to delete the theme until you have created an acceptable replacement.