Vocoders were originally invented as a way to transmit speech over low-capacity transmission media.
- Start with speech as an electronic signal (e.g. from a microphone)
- Put the signal through a multi-band filter, getting some number of new signals, each covering a different frequency range.
- Pass each of these frequency bands through an envelope tracker. This follows the volume of the signal, and converts it into a a 'volume control' signal for each band.
- Transmit this set of 'volume controls'
- Start with a continuous tone containing a rich set of frequencies - this is called the carrier tone.
- Modulate filters on this tone, using the 'volume controls' created by the encoder
By reducing speech to a slowly changing series of numbers, telecoms engineers were able to fit more speech into a scarce radio channel, submarine channel, etc.
If the carrier tone is the output of a musical instrument, you get the familiar musical effect of a 'talking synthesiser'. However there's nothing to say that the carrier signal has to come from a synthesiser. You could play a guitar into a vocoder decoder, and it would be likely to work.
A voice box is a much simpler arrangement, that works with the vibration of air, and the amps and microphones rock musicians are familiar with. An instrument is plugged into a small amplifier/speaker. A plastic tube is mounted in front of that speaker. The tube carries the sound from the speaker to the performer's mouth, where the end is gripped in their teeth. The sound resonates in the performer's mouth just like speech does, and the performer shapes the sound by shaping their mouth. By 'singing' into a microphone, the shaped sound is amplified.
There is no reason that a voice box has to be used with a guitar. Any instrument capable of driving the small amplifier could be used.