Never been illegal to my knowledge. At least in WI. Same brand dealer has to work on your vehicle, but other brand GM dealers are not required. Pre 2002, it was same make as dealer only. Then they came up with "crossline" warranty. Originally it was for emergency and used vehicles that a dealer sold but were a different GM brand. But that didn't last long. Soon every dealer was working all GM brands and it morphed into what we have today. We warranty all GM brands. Again, this is not a requirement but all dealers I know of do it. They want the work.
I did here recently that Caddys require Caddy stores though.