Can I run a Sockets program on a Windows machine that's not connected to a network?
Yes, as long as TCP/IP is installed on the machine in some way.
If you have TCP/IP installed on any interface, e.g. the local loopback interface or a dialup interface, you can expect all socket operations to succeed as long as you are communicating only with yourself. You may use "localhost" as the hostname or 127.0.0.1 as the IP address.