It's not necessarily needed, but it don't half help! Some players tend to use the harmonic structure of a number to 'play over the changes'. So they will follow the chords that make up the tune, and put different melodies to that sequence. If that is done properly, then any improv. will work well.
If the melody is known, then another sort of improv. can be used - working with the rhythmic motifs of the piece. For instance, the tune can be turned around, and maybe played using the same notes, but in a different order. (No reference here to Morecome and Wise !) Obviously, this is pretty difficult if the tune isn't known.
Some tunes have stops and starts in them, which really get dictated by the melody, so knowing them, even the drummer can be with the rest of the band.
In jazz improv., it's often 'in the moment', and it's good to be able to just play a brand new number, and improv over it. If it's brand new - how can anyone know it?
So - yes and no. Some musos will improv without that knowledge; some will 'learn' the tune by the time they're on the third verse; some only need the chord structure. Knowing a song cannot be detrimental, but for some, it may not make their playing better - I'm probably talking about the upper echelons here.
Having said all that, often lead sheets are used, which will have the basic melody and chords, so it could depend on how quickly an individual can 'learn' the melody, if that's what you allude to. Semantics here - what might 'learn'or 'know' mean in a live play situation?
Generally speaking, the melody will match the chords for any given song, so are the two not joined anyway?