To answer the question, yes you can, but not to the extent you could using weights or weight machines. To continually build muscle, they must be continually and progressively overloaded, meaning you have to constantly work them harder if you want to continue to pack on the weight.
The real question is “Why are you putting on muscle?” If your goal is to compete in bodybuilding competitions, then only using bodyweight training exercises will not get you there. However, if you want to build functional muscle – muscle strength that you can use in everyday life – bodyweight exercises will far exceed what you can get from conventional strength training alone due to the difference between the two forms and how they work the muscles. With bodyweight training, a muscle is elongated during the exercise – called isometric contraction, whereas with weight training, the muscle is contracted called eccentric contraction. The later builds bulk while the former tones, and builds definition and sleekness. Don’t gymnasts look more balanced body wise than most bodybuilders and weightlifters?
Some of the exercises using just bodyweight are identical to the ones involving a piece of weighted equipment. For example, what is the difference between a chin-up and lat pulldown? Actually with the weight the same, nothing, as both types of exercises use the same muscles. However, with lat pulldowns, you could progressively add weight as you max out on repetitions, where with chin-ups you are limited to just your bodyweight.
But there are techniques to make bodyweight exercises more effective. Gymnasts use isometric contraction to their advantage. Basically it is holding your weight in one position over a set amount of time, thus continually stressing that particular muscle for that duration. Think the routines they do on a set of rings holding their bodyweight using just their outstretched arms!
To demonstrate how you can use isometric contraction to your advantage, let’s look at the pushup. From the starting position, lower yourself but stop just before your upper arms are parallel with the floor. Hold that position for 40 to 60 seconds. Now do a cluster set of 5 pushups where you do one push-up, rest 10 seconds, do another, rest, etc. As you build muscle, either hold in position longer, do more repetitions in each cluster set, or add in more complete pushup sets.
With some imagination, most of the bodyweight exercises “can be taken to the next level” by using the hold-in-position-and-then-cluster-set routine. So if you are looking to get buff, but not muscle bound, then yes bodyweight training exercise will build muscle where you want it.