Pokemon originating in gens III and IV, where those balls are usable, cannot have their hidden abilities, and, due to the breeding mechanics of gen VI (where the female will pass the ball, and the hidden ability if it has it), it was impossible to breed a HA Pokemon in balls other than those usable in gens V and VI, and of course PKHeX would mark them as illegal.
However, due to the changes of ball inheritance in gen VII, where breeding Pokemon of the same species has a 50% chance of passing the male's ball, means that it is theorically possible to get HA Pokemon in those 2 kinds of balls:
Say, breeding a Gen III male Pinsir caught in a Safari Ball with a female Moxie Pinsir would have a chance of producing a Moxie Pinsir in a Safari Ball. I have to test it out to see if it is anything more than a conjecture, but, if positive, HA Pokemon in pre-Gen V balls may be legal, as long as they originate in SM.
Thanks for your time.