Can I control a stepper motor with a sensor?
Yes, you can, they are completely independent, but that does not mean you can use e.g. an Arduino Uno to do the following:


Read the sensor
Based on the sensor values, control the L293D


In case you have doubt how to start, I suggest the following:


First, only use the HC-SR04 sensor (build the circuit, use an example program, check that it works)
Start over (remove the sensor), only use the L293D motor driver shield (with a motor), use an example program, check that it works)
Now combine both circuits and programs or if you feel confident enough, start making your entirely new program.