Probably, but its extremely minor.
In fact here I am playing a guitar made of an oil can; the wood in there is mostly agathis (very cheap wood) and is only used to line the frame – the majority of the body is completely hollow.
Gear used: Bohemian TNT (modified with Lollar Gold Foil pickups) + Vox MV50 Boutique head+Vox BC108 cabinet
Total cost of gear: $250 (guitar) +$400 (pickups) +$300 (amp+cabinet) = $950
Do you think I got less sustain than I did with my Fender Stratocaster (with alder body)? Surprise! Not really. The amount of sustain was way more affected by my guitar pickups, amp and pedals than from me using a guitar with an oil can body.
In fact I changed the pickups on there so I know that inside the body, the pickups are connected by a piece of cardboard I had superglued in there since there wasnt enough wood on the neck to mount the pickup (and as mentioned the body was completely hollow inside). The neck was barely even making contact with the body. You’d think that would affect sustain too but it didn’t.
So this seems to be a conclusive experiment for me, which tells me that no, wood does not really matter all that much in an electric guitar- it might affect the tone but it gets completely drowned out by other factors.
So take from it what you will – all that marketing that guitar makers do about how nitro vs poly lacquer, short tenon vs long tenon, large mass trem blocks etc take it with a grain of salt because in the end I don’t think that stuff really makes that big of a difference. Unless you play your electric guitar without an amp. But who does that? lol