To annul a marriage a verdict of a court is necessary. For that the wife must apply in a shari'a court. And they must verify her statement etc..
Note that a nullification of a marriage rarely happens after living together for a long period of time, but this needs clear evidences that this marriage was not legally correct in first place. So what you may mean is rather khul'a (as you speak of violence which could be a valid reason to apply for khul'a) which also needs an application at a shari'a court and the wife could by herself free from this marriage if the shari'a court comes to the conclusion that the circumstances are valid for this kind of separation.
Else only the husband could end the marriage by uttering talaq.
On the other hand a wife is ordered to obey a husband as long as he doesn't ask her something haram or hinder her from fulfilling her religious duties. If she disobeyed she could be considered as nashiz and in this case the husband is allowed to punish her first by advising and reminding her of her duties, and reminding her of Allah who sees and knows all of our sins etc. and secondly by forsaking them in bed and thirdly (if neither of the former options work) by beating them softly.
Men are in charge of women by [right of] what Allah has given one over the other and what they spend [for maintenance] from their wealth. So righteous women are devoutly obedient, guarding in [the husband's] absence what Allah would have them guard. But those [wives] from whom you fear arrogance - [first] advise them; [then if they persist], forsake them in bed; and [finally], strike them. But if they obey you [once more], seek no means against them. Indeed, Allah is ever Exalted and Grand. (4:34)
A wife is not allowed to leave her husbands house without his consent, be it by a general consent based on trust or by asking him each time if necessary people differ in the way they might deal with this. This applies also to the case of a wife going to the house of her parents. And if the husband asks her to come home she should obey.
Also note that the husband must be in charge of his wife, so he needs to support her financially if he doesn't or he was not able to do so in some madhhabs he would loose the obedience of his wife and the wife would be free to seek annulment of the marriage. Do to the same verse as Allah made the statement in a conditioanl form by saying:
"what they spend [for maintenance] from their wealth"