is it possible to write TCP P2P program without server? When I was googling this question I found something about NAT traversal,UPnP, can I use them somehow?
It really depends what you mean by 'server'. You dont need a centralized server by any means. The term 'p2p', by its very definition, implies no centralized server.
But the apps that receive data from other apps need to be able to listen for incoming tcp/ip connections... thats typically considered 'server' functionality, even if you arent calling it a 'server'. So in your case, your p2p app would need to have both server and client (initiating connections) capabilities built into it.