If cabinet doors become loose, try tightening the screws that hold them. In many cases this will fix the problem. However, if you find that the screw(s) just turn without tightening, the threads are stripped and more effort will be required to fix the problem.
Matches, not wood dowel, have been the usual wood filler material for small (or cheap) jobs. Remove the head and stick the wood into the stripped hole, trim it to length and reinsert the screws. This can work, but matches are such a soft wood that they don’t provide the holding power available from a hardwood dowel.
For a real fix, get a dowel of slightly larger size than the original hole. Drill out the hole to fit the dowel, coat it with carpenters glue and insert it into the new hole. Let the glue set for several hours to a couple of days (see the recommendations on the glue bottle). Tap the dowel into the depth of the hole with light hits from a hammer. Saw the end of the dowel off so that the new wood is flush with the cabinet wood. After the glue sets, drill a new pilot hole and re-install the cabinet door. This will fix the problem well.