Nowadays, with the increasing demand for hydrogen in developed countries, the optimization problems of multimicrogrids (MMG) equipped with hydrogen-based facilities, e.g. power-to-hydrogen technology and hydrogen storage, have attracted tremendous attention. On the one hand, the unpredictable occurrence of contingencies makes the optimal operation of MMG systems more challenging. On the other hand, MMG operators should use powerful techniques to appropriately model different uncertain parameters in their energy management problems. In this respect, this paper aims to propose a contingency-constrained optimal operation model for an islanded MMG system based on power and hydrogen considering multiple uncertainties, electrical storage, and demand response (DR) resources. In order to make the proposed model more realistic, the impact of contingencies such as the unexpected outage of tie lines or generation units on the economic performance of the MMG system is evaluated. To appropriately model the uncertain nature of the electrical load, and power generation of renewable energy sources, a scenario-based approach is used. Moreover, incentive-based DR programs are employed to reduce the operating cost of the MMG system. With the implementation of such programs, flexible electricity consumers of the microgrids are motivated to curtail a portion of their load in peak hours. The extracted results demonstrate that DR employment improves the operating cost of the MMG system by about 26.8%. Furthermore, the consideration of unexpected outages, which makes the scheduling model more realistic, increases the operational cost of the system by about 1.51%.