Most people are able to restrain themselves from physically attacking people in those circumstances. Why is it okay to try to beat up people when you're being lawfully detained? Even the countries that recognize prisoners having a "right to attempt escape" still charge them with whatever crimes they did in the course of attempting to escape, such as assaulting guards.