All the main Metroid games are in the same timeline. It's just that the previous Prime games all took place between Metroid 1 and Metroid 2, which is why they have Metroids as enemies (since they were pretty much extinct after Metroid 2). It's still not entirely certain if this is also the case with 4, but I think it's pretty likely.