It is very, very rare for earth animals to not be able to swim to some degree. Even humans can swim instinctively. There's no reason to believe the Andalite planet doesn't have lakes, rivers and oceans (actually, doesn't Ax say something about his homeworld being similar, but with less water?).
The Hork-Bajir planet is something of an unusual case. Even if there are rivers (if there are oceans, they're below The Deep), Hork-Bajir don't spend much time on the ground. What's the point of swimming if you can jump from one tree to another over a river?
So, Hork-Bajir are unknown. Andalites can swim.