If a site is hosted as a Team site, in either SharePoint Online or SharePoint 2016
Can the template of the site be changed to a Record center or Document Center. If so would the document libraries adapt to it accordingly?
As per experience, it is near to impossible to change the template once you create the site collection. Main reason, MSFT build a structure in each template once you change your existing site collection template then many features not supported in other template and throws the error.
What i would recommend, create a new site collection using the desired template. After this manually move the content from old site to new site.