Traffic between the ports travel through the USB connection between your Android device and development machine, so the connection doesn't depend on your network configuration.
Port forwarding works by creating a listening TCP port on your Android device that maps to a TCP port on your development machine. Port forwarding enables your Android device to access content that's being hosted on your development machine's web server. With a USB cable and Chrome DevTools, you can run a site from a development machine and then view the site on an Android device.
Host a site on a development machine web server, then access the content from an Android device.