The 2019 novel coronavirus disease (COVID-19) has become a severe public health and social problem worldwide. A limitation of the existing literature is that multiple environmental variables have not been frequently elaborated, which is why the overall effect of the environment on COVID-19 has not been conclusive. In this study, we used generalized additive model (GAM) to detect the relationship between meteorological and air pollution variables and COVID-19 in four urban agglomerations in China and made comparisons among the urban agglomerations. The four urban agglomerations are Beijing-Tianjin-Hebei (BTH), middle reaches of the Yangtze River (MYR), Yangtze River Delta (YRD), and the Pearl River Delta (PRD). The daily rates of average precipitation, temperature, relative humidity, sunshine duration, and atmospheric pressure were selected as meteorological variables. The PM2.5, PM10, sulfur dioxide (SO2), nitrogen dioxide (NO2), ozone (O3), and carbon monoxide (CO) contents were selected as air pollution variables. The results indicated that meteorological and air pollution variables tended to be significantly correlated. Moreover, the nature of the relationship between severe acute respiratory syndrome coronavirus 2 (SARS-CoV-2) and meteorological and air pollution variables (i.e., linear or nonlinear) varied with urban agglomerations. Among the variance explained by GAMs, BTH had the highest value (75.4%), while MYR had the lowest value (35.2%). The values of the YRD and PRD were between the above two, namely 45.6% and 62.2%, respectively. The findings showed that the association between SARS-CoV-2 and meteorological and air pollution variables varied in regions, making it difficult to obtain a relationship that is applicable to every region. Moreover, this study enriches our understanding of SARS-CoV-2. It is required to create awareness within the government that anti-COVID-19 measures should be adapted to the local meteorological and air pollution conditions.