Legal? Don't really know,
Last time I saw a tire change done was back in the days of 1/10th gas truck. Which was a pretty long time ago. It was only a two tire change, so the time lost wasn't like it might be for a four tire swap. The tire change did work. When all the other racers had bald rear tires, the one racer that did the tire change was on faster/better tires and it showed. I believe that the race was down in Vegas and it was Kinwald that did the tire change during an hour long main. I could be wrong though. It's not usually done, but I don't think there are any rules saying you can't do it.