A template is a generic model which can be customized to facilitate efficient production of a specific type of resource in a specific context.
Templates can be used to produce physical resources or any type of media.
Templates are often frameworks. However, templates don't necessarily include frames, so they're not always frameworks.
Frameworks aren't necessarily templates, but they often include templates and can be templates. For example, a web framework is a developmental framework which often includes default or even "boilerplate" code modules, which are customizable templates.