Analogy in capillary condensation mechanism across simple nanoconfinements