Cyclophosphamide (CTX) is an anticancer medication that suppresses host immunity as well as adversely affects mucosal inflammation and gut microflora dysbiosis. The gut microflora is recognized as a substantial factor in host metabolism and immunological homeostasis. To improve immunity and inhibit cytotoxic and homeostatic imbalances triggered by CTX, it is essential to monitor immunoregulators. In this research, we assessed the impact of Octopus peptide hydrolysate (OPH) on immune modulation, intestinal integrity, and gut microbial composition in CTX-induced immune-deficient mice. The results revealed that OPH increased body weight, and immunological organ indices, and improved the histological changes in the colon, thymus, and spleen. The OPH stimulated the secretion of cytokines (IL-1β, IL-6, and TNF-α) and antibodies (IgM and IgA) while reducing the ratio of lipopolysaccharide (LPS) and diamine oxidase (DAO) in the serum. OPH further enhanced goblet cell and mucus production, upregulated the expression of gut tight-junction proteins (Occludin, Zonula Occludin-1, Mucin-2, and Claudin-1), and activated the TLR4/NF-κB cascade (p-IκBα, P65/p-p65). In addition, OPH treatment declined the Bacteroidetes/Firmicutes ratio, enhanced the relative ratio of Alistipes/Lachnospiraceae, and reversed the ecological equilibrium of the gut microflora. The findings revealed that OPH serves as a prebiotic to prevent CTX-mediated disruption in the intestinal barrier and boosts gut mucosal immunity by attenuating gut microflora imbalance, implying that OPH could be used as an immunological ingredient in nutritious foods to regulate the immune system and protect the gut from inflammatory diseases.