It is a complicated and difficult process to get a visa from most countries of the world as an Iranian citizen. Now I want to know that visas of which countries are needed for this reason and is there any visas only to get to Antarctica then immediately come back home without staying in the other countries like a transit visa?
Depends where you are coming from, and how to get to that transit country. If you come by air, you can go form Australia or Chile. More people however seem to come by boat. Most boats leave from New Zealand, Argentina, Chile or Australia.
I would decide between those 4 depending where is the easiest to get a Visa, and then search for operators through those specific countries.
I would not assume that you can just transit through the country without a visa, since you will have to stop over at those places to get equipment, change from airplane to boat etc, so you will have to go through immigration. If you travel by plane only even you will have the same issue because most of the airplanes going there are cargo, research or military planes that do not work like normal passenger airplanes with a switch on the airport.
well, you need no visa for Antarctica itself as it doesn't belong to any country :)
Of course as uncovery mentions you will need visa for the country you're staging from, and if you're visiting a base on Antarctica the country operating that base may want you to have a visa for that country as well.
As most countries from which you can reach Antarctica afaik have no direct flights from Iran, you're likely also going to need one or more transit visa for countries you're going to travel through along the way.
Make your travel plans, contact embassies or consulates, etc. etc.