Absolutely! There are two ways to mount stuff on a typical (drywall or plasterboard or similar on top of wood frame):
It sounds like this is what you were trying to do. Drill holes that would end in the wall cavity, and then push through some sort of expanding anchor, toggle bolt, etc. which would grip the sides of the hole and/or behind the wall surface. This is actually second-best. Far better is:
Depending on the size of the screw, which depends on what you are trying to hang on the wall, you can either drive screws directly through the item you are trying to hang, through the wall surface and into the stud, or you can drill a pilot hole and then drive the screw thought the item, through the wall surface and into the stud. You just drilled (accidentally) a pilot hole. All you need is a screw that is a little bit larger than the hole and of an appropriate length.
Typical screw length, if you don't know 100% for sure what is behind the wall, would be 1-1/2" + wall surface thickness - e.g., 2" for standard (US) drywall. You don't want to use a shorter screw because it won't hold as well. You don't want to use a longer screw because of the risk of hitting electrical wires or plumbing run through the middle of the studs.