All dealers cover warranty regardless where you bought the car. Dealer service centers are compensated by Mazda for warranty service.
Yep. I bought my CX-5 from a dealer about 25-30 miles away because they had the specific one I wanted... even though there's another Mazda dealership about 2-3 miles from me. But they were able to list the closer dealership as my primary one for maintenance purposes.