Sockets are just a way to open a communication channel between a server and a client. A socket connection just enables you to send bytes from one machine to the other, nothing more. In particular, sockets do not directly provide a way to call methods on another machine.
You will need to implement an application-level protocol on top of sockets, or use some existing (standard) application-level protocol. You could use RMI as suggested by ashiaka, or for example JAX-RS (Java's standard API for RESTful web services). Both these will use sockets to get the data across from one machine to the other.
So yes, it is possible using sockets, but you need to use something on top of that to actually remotely call methods.