Explanation
Why Correct: The sentence opens with the noun phrase "A gentleman," which the relative clause "who wishes to go abroad" directly modifies. The main verb "has" then introduces the object "a dog," and the infinitive "to sell" expresses purpose, yielding the complete sentence: "A gentleman who wishes to go abroad has a dog to sell."
Distractor Analysis: Beginning with "To sell" leaves the sentence without a subject, producing a fragment. Placing "has a dog" before "who wishes to go abroad" attaches the relative clause to "dog," making the dog the one who wishes to travel. Inserting "to sell" immediately after "A gentleman" creates an ungrammatical sequence that separates the subject from its relative clause and distorts the intended meaning.
Takeaway: In sentence rearrangement, a relative clause introduced by "who," "which," or "that" must sit immediately after the noun it modifies; placing it elsewhere changes the referent and often produces a nonsensical reading.