I've tried this on an old version of Android 10 and was unable to do so, I tested it by connecting two laptops to the hotspot and then trued to nmap each other IP addresses, they were unreachable.
I think the term you're looking for is isolated vlan in which each device on a network cannot see its peers, which is a common setting in (properly configured) public WiFi hotspots.
edit: oh, you want to access from the phone itself, I did not test that, but it should be easy to test with termux