Edit:
the development version of make4ht has the following code integrated as odttemplate filter and extension. It can be used in the following way:
make4ht -f odt+odttemplate filename.tex "odttemplate=template.odt"
Original answer:
The following build file extracts the styles.xml from a template ODT file. It acts as a filter on the styles file produced by tex4ht and replaces its contents by the extracted file:
local filter = require "make4ht-filter"
local mkutils = require "mkutils"
local zip = require "zip"
-- filter_settings "odttemplate" {
-- filename = "test.odt"
-- }
local function get_template_filename()
-- either get the template odt filename from tex4ht.sty options (make4ht filename.tex "odttemplate=test.odt")
local tex4ht_settings = settings.tex4ht_sty_par
local templatefile = tex4ht_settings:match("odttemplate=([^%,]+)")
if templatefile then return templatefile end
-- read the template odt filename from settings
local filtersettings = get_filter_settings "odttemplate"
return filtersettings.filename
end
local process = filter {function(content)
local templatefile = get_template_filename()
-- don't do anything if the template file doesn't exist
if not templatefile or not mkutils.file_exists(templatefile) then return content end
local odtfile = zip.open(templatefile)
local stylesfile = odtfile:open("styles.xml")
-- just break if the styles cannot be found
if not stylesfile then return content end
local styles = stylesfile:read("*all")
return styles
end}
-- the styles.xml is saved in a file with .4oy extension
Make:match("4oy$", process)
There are two ways how to pass information about the template file to the filter. First one is commented out in the build file. Use the filter_settings function:
filter_settings "odttemplate" {
filename = "test.odt"
}
The second way is to pass it in the tex4ht.sty options. It means either on the command line or in the \Preamble command in a private configuration file. This is how to use it from the command line:
make4ht -f odt -u sample.tex "odttemplate=test.odt"
Here is a sample that uses modified ODT file produced by tex4ht. The headings style had been changed to use a red color:

soffice --headless --convert-to docx– Denis Dec 20 '18 at 13:04