Allergenic protein structures change when processed. Some are more heat labile than others. It all depends on the protein structure.
Higher temperatures for longer times can decrease the allergenicity of the proteins, allowing it to be tolerated by some. Generally the greater the decrease in allergenicity as you heat, cook, and finally bake.
Fermenting is another way protein structures can change enough to make a difference in allergenicity, as they are partially digested into shorter chains (peptides).
Example: gluten content in regular commercial soy sauce. Many test under 20 ppm, low enough to be tolerated depending on one’s sensitivity.