Quantum energies of BPS vortices in $D=2+1$ and $D=3+1$