In short , it's not recommended.
Entra Connect must connect to the internet to contact Microsoft URLs, however a domain controller must not be exposed.
If you install Entra Connect on domain controller, you have to use a domain admins account to manage Entra Connect configuration , so you will increase the number of domain admins account in your domain
From my point of view, You should install Entra Connect only on member server and not on domain controller.
Please don't forget to accept helpful answer