Yes, and it’s recommended. Inactive plugins and themes can still have security holes. Back up your site first, then delete anything you aren’t using. Keep one default WordPress theme installed as a backup.