Limit cycles of some polynomial differential systems in dimension 2, 3 and 4, via averaging theory