Sometimes you can seat the old ball joint into the housing by tapping the rod end into the housing with a hammer. It may hold enough to get the nut off. If you are replacing the ball joint you can take a torch to the nut to expand it for more clearance as well to reduce the tendency to spin the joint in the hole.
I am assuming the old one is just worn out and sloppy. Before you remove the old one, measure from the end of the inside ball joint to a location mid point between both extremes of the "free play" and mark the housing and record the distance. When you put the new one in, adjust the ball joint so that the original distance is again obtained. That may give you the best chance of having the toe in setting correct. I hope that makes sense.