Rigid polyurethane foam, due to its low density, light weight and effective energy absorption, can be used as a new filling material to improve the energy absorption capacity of pipe fittings, thus improving the overall crashworthiness of automobiles. In this paper, numerical simulations on rigid polyurethane foam-filled origami thin-walled pipe fittings are carried out. The effects of interlayer dihedral angle, number of layers of creased pipe, and filling of foam with different densities on the crashworthiness of the pipe fittings are compared and analyzed. Additionally, an surrogate model is established to predict the correlation between the above three factors and the model. Taking the specific absorption energy (SEA) and the initial peak force (PCF) as optimization objectives, the NSGA-II algorithm and the CHC algorithm were used for optimization analysis respectively. Simulation experiments were conducted to validate the accuracy of the optimized structural parameters. The results show that the CHC algorithm provides more accurate optimization results compared to the NSGA-II algorithm. The optimized optimal interlayer dihedral angle is 150°, the number of creased tube layers is 8, and the foam density is 0.3 g/cm3. Consequently, the tubing’s specific absorption energy is enhanced by 10.3 % compared to ordinary straight tubing, demonstrating the significant improvement in crashworthiness achieved through foam filling. This study proves that the filling of tubing with foam has excellent impact resistance, and the results provide a certain reference value for future research.