For flexible pipelines, the influence of backfill compaction on the deformation of the pipe has always been the focus of researchers. Through the finite element software, a three-dimensional soil model matching the exterior wall corrugation of the high-density polyethylene pipe was skillfully established, and the “real” finite element model of pipe-soil interaction verified the accuracy through field test. Based on the model, the strain distribution at any position of the buried HDPE pipe can be obtained. Changing the location and extent of the loose backfill, the strain and radial displacement distributions of the interior and exterior walls of the HDPE pipe under different backfill conditions when external load applied to the foundation were analyzed, and the dangerous parts of the pipe where local buckling and fracture may occur were identified. It is pointed out that when the backfill is loose, near the interface between the backfill loose region and the well-compacted region, the maximum circumferential strain occurs frequently, the exterior wall strain is more likely to increase greatly on the region near crown or invert, the interior wall strains increase in amplitude at springline, and the location of the loose region has a greater influence on the strain of the pipe than the size of the loose area.