Complete intersections in affine algebraic varieties and Stein spaces