Yes, of course. Confidence comes from knowing yourself, and what you can do. Strength training helps you know yourself, and is a continuous exploration; a process of challenging yourself and finding out what you are capable of. If you don't challenge yourself (i.e. if you just do the same things all the time), you're missing out on this benefit.
Strength training, in contrast to just "exercise", includes progress. And process with progress brings self-development. Things happen along the way as we adjust to a new, more capable self. Self-development builds confidence because any type of physical, mental, emotional, etc. development and growth builds a better person. More developed people have earned their confidence.
Strength training also includes, if we let it, practice at failure. Many of us fear and avoid failure because we see it as a bad thing. In strength traning, failure is not bad -- it's just not being able to do something beyind our current capabilities. If we all try to deadlift 1,000 lb, we'll all fail. If we try to deadlift 75 lb, we'll all suceed. Somewhere in between is a number that is hard but do-able, and somewhere just above it is a number at which we will fail. There is no inherent judgement there. Failure brings knowledge on which to build, train, and try again, and often exposes our weak links at our limit effort, which are the richest opportunities for growth. Note that I'm not advocating "training to failure" in reps, nor routinely trying to do a lift at or beyond a 1RM. But I do think that pushing into new territory sometimes in one way or another in our training --trying our best at something really hard, but failing-- is a great growth experience that we should embrace when the time is right. And when we fail we really learn what we are and aren't capable of. Again -- confidence comes from knowing yourself, and what you can do. Failure brings that knowledge.