Since A . B = AB cos theta ——-> 1

B . A = BA cos theta 

Here A and B are two vectors and Theta is the angle between them.

As AB = BA (being magnitude)

thus B . A = AB cos theta ——> 2

Comparing eq 1 and 2 we get

A .B = B . A