On a moving bike, you can steer a little to the left or right if you’re toppling to the left or right. It becomes a thing you learn, though most people fall off a few times before they master it.
On a perfectly stationary bike, you’re stuck. Either your center of mass is above the patch of ground between the patches covered by your tires, or … it isn’t.
On a not-quite stationary bike, you may be able to do a “track stand”. Turn your front wheel, and move your bike a little forward or backward, thus moving your front wheel a little to the left or right. For this, you either need a track bike, which can be pedaled backwards, or a gentle slope which’ll push your front wheel backwards if you ease up on the pedal.
Latest Answers