Can you touch the kosel? and what’s the reason you wouldn’t be allowed to
Yes you may touch the Kosel. According to most poskim and this is the minhag is Klal Yisroel for generations, that the Kosel is not the wall of the Azara of Bais Maikdash itself, rather the outer wall of the Har Habayis. Therefore, there is no problem with a Yisroel or a person that is tameh to go to the Kosel or touch it. Personally, I have seen pictures of a number of gedolim kissing passionately the Kosel.
There were gedolim (Maharil Diskin, Brisker Rov) that didn’t go near the Kosel, and stayed far away from it, however it isn’t clear the reason why. Some say it is because it is possibly the wall of the Azara, (which is very hard to understand due to the excavations that show that the Kosel goes way past the area of the Bais Hamikdash, and the Azara). Others say that it was because it was too painful for him to get too close to the Kosel and he was afraid that he might faint! (Unfortunately, I don’t think we have this problem).
There is another reason why some people stay a little bit away (11 inches) from the Kosel. This is because the walls of the Kosel are built in a way that the lower stones are thicker than the upper ones and each stone is two fingers worth further out than the one above it. Therefore, since there are 11 layers of stone below the Kosel that we see, therefore if one goes all the way up to the Kosel his whole body is within the area of the Har Habayis, which is not allowed unless the person toveled in a mikva properly. Therefore, some people don’t go all the way up to the Kosel, however, most poskim were not particular about this. There are however some poskim though that were makpid not to stick their fingers inside the Kosel,
Regarding if the Kosel is the wall of the Azara or the Har Habayis- Avnei Nezer Y:D 460, Bais Ridvaz 38, Igros Moshe O:CH 2-113, Orchos Rabeinu 1 pg. 319-3, 322-11, vol. 2 pg. 149-3, 152-11, Tzitz Eliezer 10-1(61), Yabia Omer 5-Y:D 27, 9- Y:D 11, Tshuvos V’hanhagos 1-331, Chiko Mamtakim 1 pg. 58 from R; S. Z. Auerbach zt”l.
Regarding getting close to the Kosel- Even Yisroel 3 Rambam HIlchos Bais Habechira 2-13, also see comments on M:B 561-1, MIshne Halachos 14-282, Teshuvos V’hanhagos 4-132, 5- 164. However most poskim are not particular with this- Divrei Chahomim pg. 470 regarding R’ Kook and R’ Aryeh Levin, R’ Chaim Shmuelvitz, R’ Sheinberg, and R’ Yackov Kaminetsky zt”l, Orchos Rabeinu regarding the Chazon Ish, and that the Steipler used to kiss the kosel, Chiko Mamtakim 1-58, Ashrei Hoish O:CH 3- 73-26 in the name of R’ Eliyashiv, however he says that R’ Eliyashiv was careful not to stick ones finger inside the Kosel when putting in a kvitel. Piskei Tshuvos 561-6.
Sticking fingers inside the Kosel- Aderes (see Tzirtz Eliezer 10-1 sikium-1, Orchos Rabeinu mentioned above, Ashrei Ish mentioned above.