A template is a dedicated site to be a base or model from which new sites can be built. Information in text and other media format, such as images, videos, audio, etc, may all be organized in the sections and pages of templates, so new sites won't have to be created out of empty pages.
A theme, on the other hand, is a CSS applied to sites and templates to control the aesthetics of the elements, like font style and color of the texts, animation effects on the images, padding on the tables, etc.
A theme is used to brand sites with logos, fonts and colors whereas a template is used to build iterations of sites that are similar in layout or general content. As with any site, you can change the theme in a site that was created from a template. The only structural control the theme has is the layout of captions. For example, if you build a site from a template that has the captions below images, then change the theme you may find that the captions are now next to the images.