TLDR This belief doesn't come from a myth it first appeared in Wizard of Oz.
I think the first time this belief was stated was in the the Wizard of Oz rather than in any myths. The belief probably comes from older myths/customs surroundin witches that were drawn upon to create this idea for the Wizard of Oz.
1) Water used to find witches. This took 2 forms....
As a follow-up to my (almost) namesake @Thom .
And to @Spencer
It is not specifically stated that they burn in water they are only afeared to cross it.
Tim O 'Shanter's poem says
Ah, Tam! ah, Tam! thou'll get thy fairin! In hell they'll roast
thee like a herrin! In vain thy Kate awaits thy comin! Kate soon
will be a woefu' woman! Now, do thy ...