No and Yes.
First the no bit. The GSM cellular network is designed around communication between a handset and a base station. The base station does all of the control here. Firstly it decides who can talk when (see multiple access, TDMA, CDMA, etc.) in order to allow many phones to connect. Secondly, it decides how to route a call - you call up a number on your handset, your handset asks the base station to connect the call, and the base station then decides how to proceed - can it ring a phone on the same tower or does it have to route to another tower.
There is nothing designed into the GSM network methodology that allows two handsets to talk directly - they all have to go through the base station. In fact if you think about it, if you are in the middle of nowhere with no base station in range, and you are with your friend, do you get signal from each others phones? No, you don't, because there is no base station within range to tell the phones they are allowed to talk.
@DwayneReid also makes a good point, the Uplink and Downlink GSM frequencies are different meaning that the phones are not listening on a frequency band that phones around them are transmitting on. This is done for a very good reason - if your phone is transmitting at 1W power output, and a phone next to it was listing on the same frequency, the 1W transmission from the phone would completely drown out the ~10nW signal from the base station.
Now the yes bit. It is possible for two devices to communicate with each other directly - take a walkie-talkie for example. However, we are talking about commercial mobile phones here. So can it be done?
Well, we know that GSM is out of the question. But there are also methods for phones to talk nearby. You can get Bluetooth modems with a range of 100m as an example. You can also do VoIP if one phone sets up a Wi-Fi hotspot and the other connects.
Yes, it could be possible to get two phones to communicate nearby without going through a base station, but it would not be using GSM or the phones cellular services, it would be with the phones secondary radio services like Wi-Fi and Bluetooth.