It's possible. The After Effects stabilizer allows you to apply stabilization to the X and Y dimensions independently.
But, in the real world, handheld cameras wobble left and right just as much as up and down. And they rotate. So to productively stabilize your footage, you'll still end up with visible frame edges in the left and right of frame, requiring scaling up, masking etc.