That makes no sense. People from only Mexico and Canada, then, can be an asylum seeker? Or is that law only if they walk? If they fly, can they come from anywhere?
Yes they can fly in, but that becomes more problematic. You can't get on a plane from many places without a visa. There was a case where one of the parents separated from her daughter was a woman who flew in from Africa. She was questioned as to why she hadn't sought asylum in one of the layover countries. Initially they accused her of child trafficking, claiming her daughter was not her child, and even after the DNA results proved the child was her daughter, they were still separated.
Usually people making refugee claims have few resources for airline travel, or the documentation required to pass through airport security and citizenship documentation checks, and until you actually set foot on US soil, you cannot claim asylum.