The best way to revise sentence 6 is:
D. Barbara, who wore a pink and yellow polka-dotted dress, commanded prolonged glances from the other customers.
This option grammatically corrects the sentence by using "who" instead of "whom," which is appropriate in this context, and it also clearly states that Barbara is the one wearing the dress.