Not with a regular guitar you can't. Guitar produces "audio" which is based on vibrations or sound. MIDI works on electronic triggers. Basically a guitar records what you "hear", a MIDI device records what is triggered when a note is struck. MIDI is not a sound, but rather instructions to play a note stored in something such as a keyboard or your computer. This is why you can play drums with a keyboard. It's obviously not making a drum sound, but it's giving instructions on what the drum sounds like and what drum to play when a key is pressed on the controller.
There are MIDI guitars, and you can outfit a regular guitar with a MIDI pickup system. But definitely can't plug a guitar in and get MIDI sound.