This work presents the synthesis of corrosion inhibitor [1H-benzotriazole (BTA)]-loaded hollow silica nanocapsules with magnesium hydroxide precipitate in the shells (HSNs-M/BTA) through inverse microemulsion (W/O) polymerization. TEM and Brunauer–Emmett–Teller (BET) measurements indicate that the silica nanocapsules possess voids in the inner part and mesoporous on the surface. The actual loading capacity of BTA is 287.17 mg (BTA)/1 g (HSNs-M/BTA). The results of UV absorption spectra show that the release of BTA can be triggered by the changing of pH in the corrosion solution. The anticorrosive SiOx/ZrOx coatings embedded with hydrophobically modified HSNs-M have a better waterproof performance since the water contact angle can reach 140°. In comparison to the passive SiOx/ZrOx coatings with or without BTA, the enhanced corrosion protection performance of this developed anticorrosive system was observed by both electrochemical impedance spectroscopy and Tafel analysis. The fabrication of nanocapsules with corrosion inhibitors is promising as an intelligent element in protective coatings in the future.