After acquiring jazz, the theory, the musicians have a lot of freedom in their performance, they learn through listening what works and what moods and sounds they prefer. For some the #11 on a major tonic chord sounds off and they avoid these notes, but some jazz composers and improvisers like this sound and will add this intentionally even though the theory books will say it is a note to be avoided.
Jazz improvisation is actually a composition to be composed while on stage, Jazz is freedom as the famous composer and pianist Thelonious Monk says. You can say what you want to say in your way, to play with your dynamics and make your own phrasing. You can play close to the melody or make something new, the most important factor is that your improvisation will go together with the harmony. In this case, learning the theory and knowing why certain notes will work and others won't work on different chords, actually opens you to more possibilities when you improvise.
“The GOAL of every jazz musician is to play on their instrument (or vocally sing) what is heard in their mind. Practicing scales, chords (arpeggios), exercises in all keys will help gain facility which will help unlock the ideas that are now being held prisoner in your mind. As soon as possible, try playing what you HEAR mentally in your head! In other words, sing a short melody mentally, or sing with your mouth, and then play those exact pitches and rhythms on your instrument. This is the same procedure the jazz player uses when improvising. (Aebersold, 2010)
Jazz is about practicing, opening your ears and surprising options in music as well as harmony options. The other important component is the rhythm. It's that laid back feeling, allowing you to opt for different phrasing, triplet and swing. As Jussi Kannaste, Head of the jazz department, Sibelius Academy said in our interview-
“Practice the unknown, the goal is not to think while you improvise. To be in the moment not to follow the same groove. Laid back, rhythmic resolution. three dimension, vibrating the rhythm. The more aware I am of the heart of the rhythmic feel the more control and freedom I have in the song.”