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.
Unfortunately it is not possible to change the site template for the existing site.
You will need to provision a new site and then manually copy the data or find a tool that can migrate the content for you. Some of those migration tools can also move permissions as well.