If you mean just using IPFS in a physically or logically isolated network, that should work fine. IPFS nodes will automatically try to find and connect to nodes on the same LAN. If you’d like to set up your own bootstrap nodes you can also do that by just choosing one node to act as the bootstrap node and specifying it in the config of the other nodes – thought that might not be necessary if they’re on the same LAN.
You could also try to remove all of the default bootstrap nodes from all of your nodes and only specify your own bootstrap nodes, but it’s not guaranteed they won’t find a way to connect to nodes outside of your test network if they can connect to the internet. I’m not sure how they’d be able to, but without using the private network functionality there aren’t any hard stops.