Surface modification through dopamine-assisted codeposition with functional zwitterionic polymers can provide a simple and one-step functionalization under ambient conditions with robust and stable dopamine-surface interactions to improve the hydrophilicity of nanoporous membranes, thereby expanding their applicability to nanofiltration, ion transport, and blood purification. However, a significant knowledge gap remains in our comprehension of the mechanisms underlying the formation and deposition of dopamine/polymer aggregated coatings within nanoscale confinement. This study explores a feasible method for membrane modification through the codeposition of dopamine hydrochloride (DA) and poly(sulfobetaine methacrylate) (PSBMA) on nanopores of anodic aluminum oxide (AAO) membranes. Our findings demonstrate that the aggregated coatings of DA and PSBMA nanocomposites can effectively deposit on the surfaces within cylindrical AAO nanopores, significantly enhancing the hydrophilicity of the nanoporous membranes. The morphology and homogeneity of the nanocomposite coatings within the nanopores are further investigated by varying PSBMA molecular weights and AAO pore sizes, revealing that higher molecular weights result in more uniform deposition. This work sheds light on understanding the codeposition of DA and zwitterionic polymers in nanoscale environments, highlighting a straightforward and stable surface modification process of nanoporous membranes involving functional polymers.