That doesn't make any sense. They just sit in the outside of your ear. Nowhere near where earwax is produced.
There are other brands of in-ear headphones that you jam into your ear canal more like earplugs. Possibly those could have an effect. But AirPods Pro are nothing like that.