The F1 sprint races have no mandatory pit stops, and drivers racing flat-out to the chequered flag. But what if there is a sudden change of weather during the sprint race? For example, let's say they put slick tyres on for the race, and suddenly in the middle of the race it starts to rain. Could the drivers change to wet tyres in the middle of the sprint race?
Yes, pit stops can be carried out during a sprint session. As per the sporting regulations article 34.5 (bolding mine):
The FIA will allocate garages and an area in the pit lane on an equal basis where each Competitor may work and, within each of these designated garage areas, one position where pit stops during any practice session, sprint session or the race may be carried out.
When it comes to switching between dry and wet weather tyres I can't seem find anything in the that explicitly matches the scenario that you're describing but there is something discussing the reverse scenario in Article 30.5n):
If the formation lap is started behind the safety car because of heavy rain (see Article 49), or the sprint session or race is resumed in accordance with Article 58.10a), the use of wet-weather tyres until the safety car returns to the pits is compulsory.
A penalty under Article 54.3d) will be imposed on any driver who does not use wet weather tyres whilst the safety car is on the track at such times.
Which is basically a restriction on safety car starts/restarts in the wet saying that cars can't change to dry tires until after the safety car has gone in. i.e. once the safety car has come in the cars are free to come in to the pits and change to dry-weather tires.