Best would be to know the chord progression of the song and play the melody that fits to that progression. So then play the song, sing the melody and find the notes.
The melody notes will all (at least most of the time) be part of the scale of the key but the melody isn’t necessarily going to start on the tonic (or first note) of the scale. Again, as I said in my other post to your other question, improvising involves knowing a lot of different things (in this case, a little basic theory), at least for those of us who are not particularly gifted.
Again, just learning scales are not the key to learning how to improvise. If you were going to learn any scale, especially if you want to play country and folk styles, learn the pentatonic scale. Again, playing these six notes over and over again will not make a solo (or at least, not a very interesting one) but if you noodle around with the scale, you may start to hear some things that you like.