A good question. As you have accurately described, pepsin is indeed a protein, more specifically, a protease enzyme - a catalyst which assists the break-down of protein at certain amino-acid markers such as tryptophan and phenylalanine. As you are likely aware, proteins are composed from approximately 20 amino-acids, as shown below.
However, the chemical properties of a protein are constituted by its folding - its three-dimensional shape. This answer describes some superficial differences between protein families and the mechanism and function whereby pepsin is capable of functioning at a low pH.
Disregarding any post-translational modifications - the alterations made to a protein following translation from mRNA - proteins are made from a determined sequence of amino-acids, named its primary structure. Different classes of proteins shall have a different sequence and proportion of various amino-acids. For example, collagen fibrils are composed from a greater proportion of the amino-acids glycine-proline-hydroxyproline.
A sample of pepsin extracted from a pig (Porcine pepsin) demonstrated a higher yield of asparagine.
Secondary structure - the inter-molecular bonding between amino-acid side-chains including hydrogen-bonding and disulfide bridge. As you correctly described a protein denaturing, it is these bonds which are broken, thereby altering the protein's shape.
Although there be four principal protein structures - primary, secondary, tertiary and quaternary - the first two are most critical to understanding the ability for pepsin to withstand low pH. Pepsin is originally secreted into the stomach as a proenzyme - an inactive precursor to an enzyme - called pepsinogen. When food is ingested, both pepsinogen and hydrochloric acid are released into the stomach. Returning to our primary structure, pepsinogen possesses 44 additional amino-acids compared with the active enzyme. During acidic conditions, the pepsinogen auto-catalyses its own cleavage from the additional strand, folding into the correct form.
Therefore, other proteins in high acidic conditions lose their unique three-dimensional structure due to the breaking of these inter-molecular bonds. In a sense, denaturing only specifies a transformation into an inactive protein but could be stated for pepsinogen which is 'denatured' into pepsin which attains its activity in this 'denatured' form.
For more information regarding pepsin, I would advise the following Wikipedia page as an initial resource: https://en.wikipedia.org/wiki/Pepsin
For information regarding collagen and porcine-pepsin composition, the following sources respectively may help: https://www.ncbi.nlm.nih.gov/books/NBK21582/ and https://www.ncbi.nlm.nih.gov/pmc/articles/PMC427253/?page=2
I wish you good digestion!