$\ce {POCl3}$ is a reagent well-known for enacting various functions in organic synthesis. For example, together with pyridine, it is able to dehydrate alcohols to give alkenes. Also, reacting it with a substituted amide gives chloromethyleneiminium ions. Salts containing these ions are also known as Vilsmeier reagents and they have great practical use in synthesis. The above two reactivity patterns seem to suggest that $\ce {POCl3}$ reacts with oxygen atoms containing rather high electron density, such that such reactions with other carboxylic acid derivatives at the carbonyl oxygen is not really observed. Firstly, I would like to ask if my rationalisation of its reactivity here is correct.
Also, as suggested by the same site, $\ce {POCl3}$ is also able to perform the halogenation of alcohol, in a manner similar to how $\ce {PCl5}$ performs the reaction, but only in the presence of dimethylacetamide (DMA) or dimethylformamide (DMF). Why is that the case? What particular properties of the solvent allow the transformation to be effected?