You cannot resist arrest. The legal system will determine whether the arrest was lawful or not afterwards. Resisting arrest puts anyone in the danger of getting killed. Thats it...its simple.
The law says that you can, it’s a right, just as it is someone’s right to bear arms, etc. You can just pick and choose which rights are important.