if you have a progression like I vi IV V, ( which include a minor chord) is ok to use the major pentatonic for soloing,or do I have to stay with the minor pentatonic because of the minor chord?
Let's translate this into specific triads C, Am, F G. All these triads are in C Major, so
1) Play C Major (CDEFGAB) or C Major Pentatonic (CDEGA) over all of them. Those are the "key scales".
(A general principle of soloing is don't "SIT" on the fourth or minor sixth of any chord. "Avoiding" notes is a silly idea. Of course you can play note C over chord G if you resolve it elegantly.)
2) For variation, each triad has its own Pentatonic scale, and all of these scale are subsets of C Major:
Am --> Am Pentatonic (ACDEG)
F --> F Major Pentatonic (FGACD)
G --> G Major Pentatonic (GABDE)
If you want to be a real musician I suggest you learn this in all 12 keys.
Those four chords are all diatonic in the same key, so your major pentatonic scales will work over all of them, as will the key's full major scale.
The major pentatonic will cover the 'correct' notes. The only quirk will be the dominant chord (V) where the c is 'considered' an avoid note. See also here https://en.wikipedia.org/wiki/Avoid_note
The minor (or major) pent will reflect notes from the KEY, rather than any other minor chord in that key. So, put another way, in, say, C major, use C major pent notes and it'll all work fairly well. If you want to use minor pent notes, well, serendipity, use A minor pent because the notes happen to be EXACTLY THE SAME!
If you wanted to put an edge to what you play, then use C minor pent, which will work in a bluesy way over the same chord sequence. Strange how it works, but it's been used millions of times with great success. It does help, though, on the root chord (C here) to bend up the minor third to a sweeter major third.