Scaling phenomena driven by inhomogeneous conditions at first-order quantum transitions