A car flipped onto its roof in a crash in west Dorset.