In competitive, it is imperative to use the best ability possible for a Pokémon's Role. You can breed a Pokémon with a HA with another Pokémon of the same species (or ditto) and hatch a Pokémon with an HA. There are also a few other ways to get HA Pokémon, like SOS chaining. As for legendaries with HA's, people find ways of getting their hands on ones that are released. They either come from events or Virtual console transfers from Pokémon Bank :P