The clue in who this is speaking about is right at the beginning of the chapter. You have to trust the bible .
1¶But there were false prophets also among the people, even as there shall be false teachers among you, who privily shall bring in damnable heresies, even denying the Lord that bought them, and bring upon themselves swift destruction.
2 Peter 2:22. “But it is happened unto THEM.” The “them” are the false prophets and false teachers discussed throughout the chapter. “The dog is turned to HIS own vomit.” In respect to verse one, that is the false prophets; they’re men. “The sow that was washed to HER wallowing in the mire.” Respectively, the “sow” is the false teachers; they’re women.
20 For if after they have escaped the pollutions of the world through the knowledge of the Lord and Saviour Jesus Christ, they are again entangled therein, and overcome, the latter end is worse with them than the beginning.
Again, there is no refuting the fact that this scripture states after they have ESCAPED the pollution of the world through the knowledge of Christ, they are AGAIN ENTANGLED therein, and OVERCOME
21 For it had been better for them not to have known the way of righteousness, than, after they have known it, to turn from the holy commandment delivered unto them.
Read the words. it had been better for them NOT TO HAVE KNOWN the way of righteousness, than, AFTER THEY HAVE KNOWN IT, to TURN from the holy commandment
22 But it is happened unto them according to the true proverb, The dog is turned to his own vomit again; and the sow that was washed to her wallowing in the mire.
I find it curious that your teachers found it needful to assign gender to the the stated proverb (a meaningless gesture). But the proverb itself confirms that like a dog those who have once known righteousness to turn back to sin, like a sow who was cleaned to turn back to wallow in filth.