Yes, that is entirely possible. I think I did it once a long time ago, but I was not sure about the commands. What you need to do is open a modem terminal so as to issue commands to your modem. You will need to do this on both computers.
When looking up the commands, I ran across this page...
Now, I know that when I did this with my Dad many years ago, we did not use any equipment like this. We just used a standard phone line.
Those commands on the page look about right though (use ATD on one computer and the go to the other and enter the ATA command). That should get the modems to establish a connection.