Why we do not get hurt from HCl secreted in the stomach?
Goblet cells.

These are specialized epithelial cells whose job it is to produce mucins. Mucous role is not only important in protecting the epithelium of the digestive tract from HCl, it is also a very important substance in the innate immune system, acting as a barrier defense to trap pathogens and/or prevent them from breaching the epithelium and gaining access to sterile parts of the body.