In this paper, we construct soliton solutions for a generalized variable-coefficient coupled Hirota-Maxwell-Bloch system, which can describe the ultrashort optical pulse propagation in a nonlinear, dispersive fiber doped with two-level resonant atoms. Under certain transformations and constraints, one- and two-soliton solutions are obtained via the Hirota method and symbolic computation, and soliton collisions are graphically presented and analyzed. One soliton is shown to maintain its amplitude and shape during the propagation. Soliton collision is elastic, while bright two-peak solitons and dark two-peak solitons are also observed. We discuss the influence of the coefficients for the group velocity, group-velocity dispersion (GVD), self-phase modulation, distribution of the dopant, and Stark shift on the soliton propagation and collision features, with those coefficients are set as some constants and functions, respectively. We find the group velocity and self-phase modulation can change the solitons' amplitudes and widths, and the solitons become curved when the GVD and distribution of the dopant are chosen as some functions. When the Stark shift is chosen as a certain constant, the two peaks of bright two-peak solitons and dark two-peak solitons are not parallel. In addition, we observe the periodic collision of the two solitons.