Pair-density-wave superconductor from doping Haldane chain and rung-singlet ladder