Well it’s just vibrations isn’t it? So the more the wood is vibrating the better the sustain. Depends on; hardware that has contact with the strings, wood choice, construction, and the strings themselves.
I reckon plenty of decent records have been made with a bass that doesn’t sustain but has other qualities or characteristics.