In general, the answer is yes, but it depends on the major mode providing the functions necessary for code formatting. I'm not exactly sure what this looks like for Lisps, but I'd guess most of these functions are provided by SMIE (
https://www.gnu.org/software/emacs/manual/html_node/elisp/SM...).
There are built in minor modes such as electric-indent-mode that indent automatically, but I personally use aggressive-indent-mode.