I play the electric and acoustic some and basically how electric works is it sends the sound through a wire analog signal, so if you put a device inbetween it and the speaker it can change the sound to whatever it fancies for output, for example my effects board I have lets me play things like acoustic sounding, solo lead sound, bass sound, eric clapton guitar type sound, etc. Basically the main factor to the final sound will either be an effects board or other pedal type devices or even the amp itself many times have some basic sound modifiers to do distortion effect, so no different in guitar. What is a main factor are the pickups on the guitar as these are what pickup the vibrations of the strings, if they are a poor quality then the sound will not be a great quality, etc.
Another factor are that some guitars are built to support a whammy bar which provides additional effects to player. My fav. guitar is the fender strat. Hope this helps.