Did you see UDP Port Mapping - Sending data from Container to Host - #5 by ivor50?
And note that the host system may be accessed from a container using host.docker.internal
(for Linux also set --add-host=host.docker.internal:host-gateway
to enable this). See also Can you proxy all network trafic outgoing from docker to a proxy running on the host? - #7 by meyay.