For rulers are not a terror to good works, but to the evil. Wilt thou then not be afraid of the power? do that which is good, and thou shalt have praise of the same:
Note 5 at Ro 13:3: There are certainly scriptural exceptions to this statement. The Egyptian government turned on the Israelites (Ex 1:8-22) not because of any sin on their part but because of the insecurities and fears of the Pharaoh. James the apostle was killed by Herod just because it pleased the Jews (Ac 12:2-3). John the Baptist was imprisoned and beheaded by Herod, and Jesus Himself commented on the innocence of John (Mt 11:9-11).
However, there is a truth that, as a whole, even corrupt governments do not bother those who are doing good. Paul was an example of this. Many times the Roman government actually came to his defense (Ac 18:12-16, 19:35-41, 21:31-36, 23:23-24, 25:1-5, and 27:42-44). In the book of Daniel, Daniel and his three friends were repeatedly honored even though the governmental system was corrupt and unjust. Joseph prospered in Egypt despite the injustices done to him.
With few exceptions, governments are established to protect the good and punish the evil. If we do good, we have nothing to fear.