Is there an option to block local network access for apps?

I’m trying to prevent apps from accessing other devices on the same network (LAN). Something similar to this iOS setting.
Some searching led me to this feature in Express VPN. Is there a way to do this in Android Settings or using a non-vpn app?