Learning to improvise in the style that Baroque musicians used at that time is quite a deep field of study. It's what we call "historically-informed performance practice."
If you have a score that has the originally-published markings for turns, trills and ornaments, then there are specific rules on what notes to play. There is certainly room for a little improvising and using your own phrasing, but if you want to play like a Baroque musician (well, as well as we can tell from scholarship after 300 years) then you need to find a textbook resource for Baroque ornamentation.
The appropriate places in a Baroque score where you can more purely improvise are at cadenzas, which are usually performed at the end of a section where there is a fermata for the accompaniment and the soloist is allowed to "cut loose".
I happen to be friends with a college professor whose specialty is Baroque oboe. I'm going to ask him if he has any specific textbook references for Baroque ornamentation. If he gives me any, I'll post them here.
I would also suggest that you look for recordings that you know to be in Baroque historically-informed performance style, and listen to how the soloist ornaments their playing. If you can listen to a sample of the recording online, you can spot a Baroque performance because it won't be in standard A=440 tuning. Modern musicians who play Baroque instruments tune down one half-step or even a whole step for early Baroque, because that is near the tuning that people used 300 years ago. So although it's written in D minor, a historically-informed recording will be played on instruments that sound like they are playing the piece in D-flat minor or E-minor according to your tuning fork.