Dear student.
Hydrochloric acid, (very strong acid), is secreted by the parietal cells present in the stomach.
The innermost layer of stomach is called mucosa. It’s a simple epithelial tissue. These mucus cells found throughout the stomach lining secrete mucus which protects the stomach from the strong acidic action of Hydrochloric Acid. Mucus contain Bicarbonate ions (HCO3) - As these bicarbonate ions are alkaline in nature, they neutralise the effect of this strong Hydrochloric Acid. Thus the continuous secretion of these bicarbonate ions protects the stomach from being digested by hydrochloric acid.
Thus HCl cannot damage our stomach, but in rare case, if HCl penetrates the mucus, it will damage the lumen and lining wall of the stomach.
Regards.