The system inside the headphones won’t be able to interpret the signals from the electric guitar. So the answer is no, even if you have a jack that would allow you to plug your earphones directly into your electric guitar, it simply won’t work. You won’t hear anything unless there is a medium to amplify the sounds from the electric guitar. That is why there is a need to use an audio interface or amp before connecting to your headphones. Some guitar amps would have a headphone jack, it would be labeled in order to avoid confusion. Not all, however, would have an output for a headphone. In that case, you would need an audio interface plugged in the amplifier so you could connect it to your headphones. It is helpful to use headphones while practicing electric guitar. You won’t expect to play the guitar perfectly on your first try, therefore, in order to spare others from the continuous cracking noise of you practicing the guitar. It is also helpful to avoid distractions while playing. With headphones on, you will only hear the tunes from your guitar that would separate you for a moment from the world.