It's easy enough to do city stays on your own. I've done city stays of from 6 days to 30 days and I agree that it's nice to unpack once in a place and explore the area on day trips or day tours. With the cities you want to include in this one trip you would have to be sure that in addition to the week in each you allow for a whole day's travel between each base city. It's certainly possible to take trains from Madrid to Paris, and Paris to Rome but they are each about 10 hour trips so flying would probably be the choice for most people. I usually limit my train rides to 6 hrs or less but I've been known to take long train journeys like this because I hate flying and I hate airports. However in this case you most likely have to fly from whatever city you're currently in to Krakow as there are no logical train connections between them.
Logical itinerary would be to fly into Madrid, then Paris, then Rome, then Krakow and fly home from Karkow - or the reverse. If I had the time and the funds and those were the cities I wanted to visit I'd do it.
It would take some research and planning but certainly doable independently. Unfortunately, you'll never find a tour of any kind that would do all four cities on one tour. You could possibly search for custom tours but the cost may be prohibitive.