Is it essential to build the 3rd Temple to restore peace in the world? If so, why? And why can only the Messiah do this? And how should this goal be achieved in a way that keeps everyone happy?
This is a very good question.
The first point, I'd like to make, is that not everybody assumes the information behind your question is correct. That is, many will argue that the Messiah is only revealed by the fact that the Temple is Rebuilt or peace is found in and around Israel. Meaning, these are signs of peace and the end times, rather than precursors to them.
However, many people DO believe that the Temple and Messiah are requirements for peace, and only the existence of the temple and the coming of Messiah can accomplish this. For the people who think that the Temple is necessary, I have normally heard the following explanation:
The existence of the temple is not just a building of bricks, and a place of sacrifices. The Temple is a concrete sign of Gd's involvement in our world. It is a location where any human being, and not just a prophet is able to physically feel Gd's presence, and to have their soul atoned for and cleansed. This remarkable experience, is not only for the Jewish people either. During the holiday of Sukkoth, people from all nations and all religions will be welcomed and able to feel this holy experience. Because of the shared holy experience, people will recognize that all human beings are the Children of Gd, and all people will recognize the planet as Gd's creation and will therefore, be inspired by Gd and will cease having jealousy and other character traits that would lead to war. The knowledge that not only is Gd real, but they can petition Gd and feel close to the Divine while on Earth, will result in world peace and proper human behavior.
The Messiah is required to build the Temple, because only somebody as holy as the Messiah must be and who is a prophet can rebuild the Temple, since it is Gd's Temple and not humanity's.
As for the location of the Temple and the current location of the Dome of the Rock, that is a solution that it would appear only the Messiah can resolve. Or rather, someone who is able to convince everybody how to do it, and not cause conflict, must be the Messiah.
If one searches the internet, there are many people who have suggestions of how this can happen.
- An earthquake or other divine action causes the Dome to collapse, and Gd's Temple is built in it's place.
- The location of the Dome of the Rock might be "off", and Gd's Temple can then instead be built in it's proper location, with the Shrine sitting just outside it's walls.
- Any mosques or shrines on the temple mount can be incorporated into the Temple that is built.
- Since the Temple would exist for all of humanity, perhaps there will be different units or sections for each of the 70 nations or religions. (This idea is not a Jewish one, but I figured I'd throw it out there anyways)