If the Template is in use then you will not be able to delete it. However, once it is finalized you should be able to delete template sucessfully.
If you are not able to edit or delete the template even when it is in the finalized state then you may be experiencing the issue described in the support article SA-37941(https://pdn.pega.com/support-articles/db-template-rule-cannot-be-deleted). This article is applicable to Pega Marketing version 7.22. If you are experiencing this behavior in Pega Marketing 7.22, create a Support Request with Pega GCS team for obtain the hotfix mentioned in the Article.