There are multiple ways:
1. From GUI which will be done in cluster leve

2. From CLI which can be done per ESXi host
VMware Documentation Library - Checking Distributed Firewall—Commands Run from Hosts
SSH into ESXi host and run below command
/etc/init.d/vShield-Stateful-Firewall stop
/etc/init.d/vShield-Stateful-Firewall {start|stop|status|restart}
3. REST API

4. Exclude VM from DFW
Exclude Virtual Machines from Firewall Protection - Exclude Virtual Machines from Firewall Protection

5. Create negate rules
VMware Documentation Library - Add a Firewall Rule
You can use negate on source/destionation/service or ports so you can choose which object to negate/exclude from DFW

I had an issue with ALG where I was using traffic direction and it wasn't work because of ALG.
In that case I use negate rules to exclude that particular traffic/VMs so it doesn't get redirected to the third party service VMs