Both Socrates and Martin Luther King Jr. believed that their principles and values were worth being incarcerated and even killed to make their points and arguments clear. I do not think that they disagreed on the issue of breaking the law. Both of these men were deeply religious and extremely intelligent. They were both thought to be on a mission from their God or Gods. Both believed that God's law was more important than man's law. Both of these men tried to educate and change their societies to be more righteous. They both believed their societies were great nations with solvable problems. They also loved their homes and their fellow man with all of his faults(hate the sin but not the sinner). The point that they both held dear was trying to better their fellow man by questioning their views on various societal issues. We can call this "Getting to the core of a man".
In Socrates" case, he believed that if he were to break the law and escape to exile he would in essence be contradicting everything he had ever believed in. Socrates believed in the Athenian system and felt that the laws were right and just. He also felt that breaking the law would be betraying Athens and its people. .
If Socrates did not believe in the system, I do not think he would have stayed in Athens to be executed. Actually, I think he would have left Athens when he was a young man. There were other alternatives for Socrates, but they all betrayed his personal beliefs. He could have been exiled, but he loved Athens and refused to leave his homeland. He could have vowed to stop teaching(sharing) his supposed impious views. Socrates could not stop sharing his knowledge with others, because he was told to do so by a God and that was more important to him than living. He could have been ordered to pay a fine. Socrates had no money, so his friends would have paid it for him. That would not have been punishment enough.