Yea, that's also what one of these do:
Just because thats what you commonly see ultrasounds being used for, does not mean that they don't have a variety of other uses. They are used quite extensively in place of exploratory surgery.
this and this.
Ultrasounds aren't really used to "check if there's a baby in there if girl dunno she is pregnant". They use it on pregnant women who already know theyre pregnant and are checking up on the baby, seeing how the baby is, how big/fast the baby is growing etc.
Pregnancy tests are usually used at home and when girls go to the doctor to make sure, they do a blood test on her. Not just shove her in the ultrasound room and do it like a metal detector at the beach lol. If im not mistaken, there's a certain week a girl can go for an ultrasound so the baby's growth doesnt get interfered with ultrasound.