This is a topic you hear people talk about periodically but don’t really get many logical conclusions out of. Here is the process I have used successfully with many athletes in regard to these two very similar topics: heat and altitude acclimation.
Before an event that’s either at altitude or in a very hot location, either arrive at the venue greater than 14 days out, or as close as possible.
1) Further than 14 days and you can actually begin to acclimate to the conditions. For heat, this means training outside during the warm part of the day and sleeping without AC.
2) When you arrive closer than 14 days, the intent should be to avoid the conditions as much as possible. This means staying inside with AC and training early in the day. If you arrive in the no-mans-land of 2-14 days, the conditions will typically deplete you rather than acclimate you since your body just doesn’t have enough time to adjust and compensate.
3) For altitude, either come further than 14 days out or as close as possible since there’s not much you can do to hide from it.
For heat, arrive further than 14 days out and train in the conditions, don’t use AC, etc. Closer than 14 days and get workouts done in the morning to avoid the heat, sleep in AC, etc. If it’s going to be less than 14 days, ideally arrive very close to the event and take these measures to avoid being depleted come race morning.
I hope this helps shed some light on an otherwise confusing topic.