As 1 Peter 3 continues, Peter gives some encouragement to those who suffer for doing what is right. You can see this for yourself in 1 Peter 3:13-14.
This idea of suffering for doing right is a common theme throughout this letter. Peter will revisit the idea of staying strong in the face of suffering again in chapter 4, verses 12-19. His encouragement to his readers is to be prepared, and to be strong.
He begins with a rhetorical question: Who is going to harm you for doing what is good? The answer, of course, is no one. That seems to be at odds with what he is writing about though, and at odds with what his readers are experiencing. And later, he will state that suffering for doing good is nothing strange or unexpected (4:12 and 5:9).
So what does he mean by this statement? I think he is referring back to his use of Psalm 34, which he just quoted in the previous paragraph. In Psalm 34, we see that God is in control, and is aware of everything that happens to his people. He rewards the righteous, and ultimately, will allow no harm to come to them. This statement here is the conclusion of Peter’s use and exhortation of Psalm 34. It parallels Paul’s thoughts in Romans 8, where he states that nothing can separate us from the love of God, or, as Peter refers to it, our inheritance.