Does a wife have to live anywhere where the husband is telling her to live? Or she has right to say no?

For example: the wife wants to live close to her family because in the past the husband and his family did not treat her right.

Yes, she have to be with her husband.
If she does not want to leave her parents city, or wants to live in certain area, she should mention this as a condition in the marriage contract.
However, he has to allocate separate house for her, if she is not willing to live with his parents or family.