It's easy to remedy this problem, when foam soap or sanitizer soap containers become clogged and squirts all over when you pump. I use a toothpick to run through the rim, taking care to remove all the clogged soap. Works like a charm.
We usually don't have toothpicks, but we've learned that unbending the end of one of our large, metal paper clips also works.
That is really a problem for me with large bottles of body lotion and the pumps. The lotion in the end of the pump dries--my son calls those 'lotion bugers'. I never thought of using a toothpick or paper clip.