Major and minor pentatonics are safe ways to navigate major and minor keys, but that is only one improvisational technique out of many. Just to give you an idea, if the chord during a solo is a C major, any C, E, or G you play is guaranteed to fit. But what about the notes in between the chord tones? Truth is, you can play whichever you like. Between C and E, there are three notes to choose from. Some will sound more familiar and predictable to listeners, and others will sound out there, and will strain the tolerance of the listeners. But rest assured they are all valid.
If you haven’t already done so, I would encourage you to start learning music theory to gain a wider appreciation of what notes are available during solos, and why. In the meantime, start to experiment with chromatics in between the chord tones.