Allgaier, who took four tires on his Kelley-Earnhardt-Miller Chevrolet in one of the late cautions, held off Ryan Blaney and Erik Jones.
Blaney, who started the day 33rd after missing the qualifying, pulled ahead of Jones before the final lap to finish second.
Jones and Blaney won the first and second stages of NASCAR's three-stage format.
There were nine caution flags for 54 laps of the 200-lap race.
The temperature at Phoenix International Raceway in the barren hills southwest of the city was 93 degrees when the race started and 96 by the end.