If youre talking about the legends for Mirage Spots, then if you knock them out, they'll be gone until the requirements to get to them are fulfillled (like it being a certain time) and you have rebattled the Elite 4 & Champion.
Basically, if you accidentally make it faint, you'll need to challenge (and beat) the Elite 4 & Champion before going after it. This is why many people decide to save their game before encountering a legendary, this way if you do not catch it you can simply soft-reset (L+R+Start buttons).
And Mirage Spots are always in the same spot. For example, the Pathless Plain will always be near Pacifidlog Town, it won't suddenly appear next to Fallarbor Town. Even the non-legend ones will always be in the same spot, and even though they would share a name with many other islands, the Pokémon, items and location are unique to each island.