Very possible. In fact the Java API has all the things you need to do this without too much trouble. Have a look at he Server Socket and the Socket classes.
Basically you open a ServerSocket on an arbitrary port the server, the client then opens a Socket connection to the server's IP/port, and you can then use ordinary streams to send raw data or whole objects back & forth.
Only tricky bit can be getting the server's IP address . If you don't mind typing it in that's OK, otherwise look at JmDMS (google it) which is an open source 100% Java version of the protocol used by (among others) Apple's products to find servers on the LAN.
Yes any PC can be either or both.
The client needs to know the server's IP address and port, that's all.
The server starts first, the client then connects to it, then either side can open an output stream to write to the other side over that socket connection.
Glad to help. If you decide you need JmDNS come back here and we can swap notes. I found it very confusing (no documentation worth speaking of) and spent some time hacking together a simple cover that gave me a dead simple interface fror just locating a simple server. I'd be happy to share that with you (or anyone else listening) in exchange for as promise of feedback and a copy of any enhancements you may make.
root = tkinter.Tk()
buttons=[i for i in range(10)]
#If specific button is pressed, output "YES"
for num in buttons: