I have enabled chemfig support on my localhost Moodle (Version 3.10) installation running with Apache 2.4.29, MySQL 5.7.33, PHP 7.2.34, Ghostscript 9.26, Tex 3.14 (Tex Live 2017) on elementary OS 5.1 ) using below steps. It is working fine.
1. Disable Mathjax Filter and Enable Tex Filter in Administration > Site administration > Plugins > Filters > Manage filters
2. Ensure Ghostscript and TexLive with chemfig package is installed on machine on which Moodle is running. I have installed texlive-full on my machine.
3. Update Latex Renderer Settings in Administration > Site administration > Plugins > Filters > Tex Notation.
a. In LaTeX preamble add text \usepackage{chemfig} and also append the chemfig in in \RequirePackage declaration.
b. On the same settings page --> Ensure path to latex, dvips, convert, dvisvgm is correctly detected.
Now chemfig package can be used by declaring LaTeX math environment. If there occurs some error, enable the DEVELOPER mode on debugger (Administration > Site administration > Development>Debugging).
In my case, Tex was making dvi file correctly, but there was error when converting to png or svg. So by following the debugger messages, I modified the two lines of code in required file. I have not documented the modification, but that should be easier to find with debugger enabled.
Reference Document: https://docs.moodle.org/310/en/TeX_notation_filter