Where does ground of wall socket actually go? Like maybe a nail in soil beneath building? Or maybe high voltage power grid utility has it's own ground, which connects to a power plant, and our building's ground connects to it? A lightning once struck a power tower, and burned my desktop PC. Does this suggest that power grid ground connects to buildings? And once power tower ground is struck by lightning, it burns electronics in buildings?
It depends on your country, some countries do it slightly differently.
The North American approach is that the power company supplies hots and neutral. You establish ground right at the house with 2 "nails" as you say, that are 2.5m long. (8 feet). Also, neutral and ground are bonded to each other at the main service point ONLY (the service disconnect aka main breaker)... so if a lightning strike comes in from the power company, it should take the bond over to the aforementioned grounding rods.
Of course in fact, lightning goes everywhere.
Further, power distribution lines in lightning country are supposed to have a "ground" wire running along the very top, above the main conductors, that is supposed to catch the lightning. Also, the 3 hot wires (distribution uses only 3 hots, no neutral yet) are supposed to have lightning arrestors (VBO devices) that insulate normal voltages but conduct lighting to ground. A lightning arrestor is an arrangement that brings the conductor close to a ground conductor, and the gap is wide enough that service currents won't leap the gap, but lightning will.
The ground of your wall socket connects to the ground connection of your building. This may indeed be a "big nail in soil" as indicated in the links in the comments (actually several of them in order to minimize the resistance to the surrounding ground), or a conductor buried into the concrete foundation, or something along these lines, depending on the age of the building.
For the end user, that's it.
Depending on the earthing/grounding system, it can also happen that it is connected to the neutral line of your power grid (in TN systems). In this case, it has to happen at exactly one place, which is either the main panel or, in the case of a TN-C-S system, the place where you go from Combined (PEN = combined protective earth and neutral) to Separated (PE = Protective Earth and N = Neutral separated). Especially a second connection between these two lines is usually not allowed (although the locally applicable code varies).
The reason for this is simple: if you have a significant current through your neutral wire, then the voltage at any point may be higher than the earth potential. In the ground wire, you shouldn't have significant current in order to remain as close to the earth potential as possible.
The lightning which hit the power tower probably hit the live lines.