We already have articles on the site about Hebrews 6:4-12 and Hebrews 10:26. Perhaps you can check them out. 2 Peter 2:20-22 and 2 Peter 3:14-17 are passages that show the possibility of people failing from the truth of the gospel and from true faith in Christ. There are many scriptures that show this possibility.
The key is to understand that those who can go right back to the old ways without any change were probably never true believers in the first place. This is a tricky subject, since the Bible does teach the possibility of true believers going through a time of backsliding. However, God assures us that true believers who backslide will be beset with the chastening hand of God and will never be able to rest in their backslidden condition. "For whom the Lord loveth he chasteneth, and scourgeth every son whom he receiveth" (Hebrews 12:6).
But we are also given another picture. 1 John 2:19 states, "They went out from us, but they were not of us; for if they had been of us, they would no doubt have continued with us: but they went out, that they might be made manifest that they were not all of us." This passage shows us that some return to their old ways as proof that they were not true believers in the first place. See how this truth fits in with 2 Peter 2:20-22.
2 Peter 2: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.
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.
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.
Notice the conclusion. They are as dogs who return to their own vomit or as sows (pigs) who return to the mire (the pig pen). God's people are never compared to dogs or pigs. They are sheep. But these people are still pigs (or dogs). They have never become sheep. Yes, they escaped the pollutions of the world for a time by learning the ways of Christ and reforming their actions. They knew the way of righteousness as a set of facts can be memorized. But they did not know God in their hearts. They were still pigs. And, when they return to the world, their latter end will be worse than the beginning. They will fall even deeper into sin.
This condition is illustrated by the man who was rid of the evil spirit in Matthew 12:43-45. When the evil spirit returned to the man, he found his house "empty, swept, and garnished." Because of this, he found seven other spirits "more wicked than himself" to enter and dwell in the man. So, "the last state of that man is worse than the first." The problem occurred because the man experienced reformation without regeneration. His heart was swept, but it was also empty. He cleaned up his life, but he did not have the indwelling Christ.
2 Peter 3:14-17 is dealing with the same problem. However, here Peter urges them to make sure of their salvation. We find similar exhortations in other places. 2 Corinthians 13:5 states, "Examine yourselves, whether ye be in the faith; prove your own selves. Know ye not your own selves, how that Jesus Christ is in you, except ye be reprobates?" Reprobates are those rejected from salvation (see Jeremiah 6:30) because they have never truly received Christ. They are "reprobate concerning the faith" (2 Timothy 3:8). They are "led away with the error of the wicked" (2 Peter 3:17). We must "be diligent" (2 Peter 3:14) and "beware" (2 Peter 3:17) lest we find ourselves in that number.