Figure B is a short lick using A dorian up the neck. It could work over an A minor sound (m7, m6, m9) and also works well over the aforementioned II-V chord progression, in this case Am7 to D7. Try hearing Am7 for the start of the bar changing to D7 when you play the F# note. As an A Minor lick the F# creates a nice change to the sound and can be used beautifully for adding colour over extended jams.
Another lick idea in A dorian Figure C starts on an F# this time creating an interesting sound from the outset. Working its way up to an E above the stave, the lick then descends again returning to an F# for the last note. Like the previous example this could be heard/used over Am7 to D7 or strictly Am as a starting point. Like always, create some of your own lines and licks using A dorian and then transpose to other keys.
Being able to solo as a bass player is a great asset. And you obviously can, and should, practice improvising in all styles. It’s a handy tool to be able to sound convincing and appropriate in many genres and will expand your palette and technique. Be aware that certain styles are more conducive to improvising as a bass player than others though. Jazz often involves solos from many different instruments and some rock gigs may have room to flex your improvising skills a little. Most classic rock gigs however would have you playing a supportive role and playing more lines than just soloing away.
This then brings up a couple of good points; improvising doesn’t always mean doing so as a solo or feature. The ability to improvise on a groove or improvise fills adds colour and your own personality and lets you react to what the rest of the band is doing, adding dynamics and sounds accordingly. But if it is considered a ‘solo’ or feature spot again you don’t have to just play licks, scales and arpeggios – this can also be a groove or bass line that you develop and expand on.