The answer is "yes", because virtually every part of an electric guitar affects the quality of the sound to some degree. Electric guitarists agree that the selection of woods in the body, neck and fingerboard make significant differences in timbre (the distinguishing characteristics of the tone and sound).
(When we talk about the characteristics of the sound of a certain kind of wood, or of any musical instrument as a whole, we use the French term "timbre" (pronounced like "tam-ber") and this should not be confused with the English term "timber" which refers to logs of wood cut from trees.)
The Warmoth guitar company in the USA builds "bespoke" solid bodies and necks one-at-a-time according to the specifications of the purchaser. Warmoth has tables and charts which discuss the relative merits of different kinds of wood and what effect they have on the overall sound of the guitar.
Warmoth Body Wood Options
Warmoth Neck Wood Options
The species of wood is not the only factor; the quality of the piece of wood being used also matters a great deal. Wood harvested from young trees tends to have inferior timbre (sound quality) compared to wood of the same species harvested from old trees. How old is optimal varies with the different species of wood. Wood that has been harvested and stored for several decades tends to have superior sound to wood that is used to build an instrument shortly after the tree has been harvested. So the best tone-woods are from old stocks that are aged by decades. Since this difference in quality has to do mostly with the amount of moisture in the cut wood, some builders try to accelerate the process of aging the wood by baking the wood at low temperatures in kilns to remove the moisture from inside the wood.
It is also true that certain species of woods are chosen for their beautiful grain patterns and color rather than exclusively for their timbre. Some guitar customers want to see the natural grain of the wood, while others seem to prefer wood that is painted with "automotive" colors which hide the grain.
I should also mention that many high-end solid-body bass guitar luthiers build bass bodies that use a bewildering combination of pieces of different species of wood sandwiched and glued together. These luthiers usually claim that their unique combination of several different species of wood impart a unique tonal quality. Personally I think this is going too far, and these kinds of basses are more interesting for the visual appeal of the beautiful woods rather than any discernible improvement in tone. But these bass luthiers are successful, so it must mean that their choices are pleasing to their customers.