Let’s try to put everything in order:
1). P has an electronic structure: 1s2 2s2 2p6 3s2 3p3 3d0, which means that PCl3 has empty 3d P orbitals and consequently, it is Lewis acid.
But also, PCl3 has a free electrons pair and consequently, it is Lewis base, too and can form complexes with strong Lewis acids, such as AlCl3.
2). PCl5, POCl3 and P2O5 (P4O10) still have empty 3d P orbitals but not a free electrons pair and consequently, they are Lewis acids only.
3). As being Lewis acids, POCl3 and P2O5 (P4O10) can be effective catalysts (alone or as a co-catalysts) in particular Friedel-Crafts type reactions (e.g. Vilsmeier formylation, Fries rearrangement, etc.).
4). AlCl3 is a salt of a weak amphoteric base (Al(OH)3) with a strong acid (HCl) and consequently, it has acidic properties in aqueous solutions due to the partial hydrolysis to Al(OH)3 and HCl. Higher temperatures increase the equilibrium constant and the rate of this hydrolysis.
5). Due to different co-ordination energy levels, water molecules do not escape at the same temperature in multi-hydrate complexes. Thus, dehydration of monohydrates usually occurs at ≈ 100oC, dihydrates at ≈ 120-130oC, trihydrates at ≈ 140-150oC and so on…and polyhdrates may reach up to very high temperatures.
6). At these high temperatures, the liberated water vapor quickly hydrolyse the oligohydrate or anhydrous AlCl3. However, this can be avoided by simultaneous elimination of the liberated water (e.g. vacuum in lab, azetropy in lab or industrial scale, using water scavengers in industry, etc.).
7). In other words, you can melt AlCl3 hydrate under vacuum, in a flask with a weak-medium flame and after dehydration and cooling, you can add the necessary reagents and solvents and continue with a Friedel-Crafts reaction. But this procedure demands adequate experience because a stronger flame can quickly form Al2O3 by simultaneous dehydration/ dehydrochlorination. Besides, this method is recommended only for “in situ” dehydration purpose and cannot be applied as a preparation method of anhydrous AlCl3.