I think they'd be able to learn. In fact, I'd say I'm sure they could learn.
Keep in mind, there isn't much incentive to learn US law when it's illegal for you to practice in the US. If the US allowed foreign graduates to sit for the bar and provided a visa and path to a green card to anyone who managed to pass and hold down employment, I think many foreign law schools would appear. Many would fail, but many would pass, and some would be very talented. Honestly, I don't think it would be all that different from software development, though I suppose the bar requirement would probably establish a higher floor than you see in programming.
Keep in mind, there isn't much incentive to learn US law when it's illegal for you to practice in the US. If the US allowed foreign graduates to sit for the bar and provided a visa and path to a green card to anyone who managed to pass and hold down employment, I think many foreign law schools would appear. Many would fail, but many would pass, and some would be very talented. Honestly, I don't think it would be all that different from software development, though I suppose the bar requirement would probably establish a higher floor than you see in programming.