Microgrids have emerged as a practical solution to improve the power system resilience against unpredicted failures and power outages. Microgrids offer substantial benefits for customers through the local supply of domestic demands as well as reducing curtailment during possible disruptions. Furthermore, the interdependency of natural gas and power networks is a key factor in energy systems’ resilience during critical hours. This paper suggests a probabilistic optimization of networked multi-carrier microgrids (NMCMG), addressing the uncertainties associated with thermal and electrical demands, renewable power generation, and the electricity market. The approach aims to minimize the NMCMG costs associated with the operation, maintenance, CO2e emission, startup and shutdown cost of units, incentive and penalty payments, as well as load curtailment during unpredicted failures. Moreover, two types of demand response programs (DRPs), including time-based and incentive-based DRPs, are addressed. The DRPs unlock the flexibility potentials of domestic demands to compensate for the power shortage during critical hours. The heat-power dual dependency characteristic of combined heat and power systems as a substantial technology in microgrids is considered in the model. The simulation results confirm that the suggested NMCMG not only integrates the flexibility potentials into the microgrids but also enhances the resilience of the energy systems.