DMSO is a slightly more polar solvent than DMF, but have very similar properties. The only way is to try them out experimentally, one may be marginally better than the other but unlikely to have a significant difference.
DMSO and DMF are both from the same solvent class (dipolar aprotic solvents) and have similar physical properties. For most of the organic synthesis, as DMSO can dissolve more compounds than the DMF and that might be suitable. This is my guess.
Choice of the solvent depends up on the polarity of the substrate. DMF is a aprotic solvent having lower b.p. than DMSO can be removed at lower temperature under vacuum after the reaction .
DMSO has solvent properties which resemble those of DMF. Both are from the same solvent class (dipolar aprotic solvents) and have similar physical properties. ... The most significant difference between DMSO and DMF is toxicity, which recommends DMSO as a safer replacement for DMF.
Both solvents are good and falls in the same class (dipolar aprotic), but depending on what type of chemical reactions, one can be preferred to another. DMSO is safer, result dependence and of high coordinating strength than DMF
Furthermore, the major pitfall in both solvents DMSO and DMF is their high boiling points (DMSO:189oC and DMF: 152oC) and are both harder to remove by evaporation. Both being similar in their role, DMSO could be preferred for its nucleophilicity over DMF. While DMF with freezing point of ~-61oC could be more preferable for reactions at lower temperatures than DMSO with freezing point of 19oC.
Both solvents DMF and DMSO are good aprotic solvents. However, DMSO is more polar than DMF based on their dielectric constants..So depending upon the nature of the reactioncondition , you can use either of two solvents.