Building photovoltaic (PV) power generation is intermittent, volatile, random, and uncontrollable; thus, the use of solar grid-connected power generation can lead to a series of problems, such as grid voltage fluctuations and power imbalance. As a typical flexible load, the scheduling and regulation of the heating, ventilation, and air conditioning (HVAC) system load can help a grid-connected solar grid achieve balanced and flexible operation. This study proposes a PV capacity dynamic tracking model predictive control strategy for air-conditioning systems with flexible loads. This strategy aims to effectively address the issue of unstable grid-connected output of solar PV systems. In particular, a solar radiation prediction model based on a long short-term memory neural network optimized by the grey wolf optimization algorithm was established, which effectively improved the model prediction accuracy. The cost function of HVAC flexible load control considers the law of solar PV output and the human thermal comfort model. A genetic algorithm (GA) is used to obtain the optimal control parameters for dynamic regulation. The GA was employed to efficiently and effectively optimize the control of flexible HVAC loads, considering the variability of the solar PV output and ensuring human thermal comfort. A dynamic regulation model was developed for a typical office building with a grid-connected solar PV power generation system. TRNSYS was utilized for verification based on the actual measured data and relevant meteorological parameters of the case building. A new evaluation metric, volatility, was proposed to evaluate net load fluctuation. The simulation platform based on the physical building yield results indicated a strong resemblance between the energy consumption curve under the predicted control conditions using the flexible model and the PV generation curve. Additionally, the net load volatility was measured to be 2.63. Compared with the predicted control condition without the flexible model, the net load volatility of the grid was reduced by 47.08%, and the energy-saving rate reached 10.89% in the summer.