Can I fit a bigger cassette just by changing the hub and not getting a new wheel? I have an old 29er that came with a 7 speed shimano tourney groupset, can I replace that with a 9-10 speed new set, just by getting new hubs? or the wheel cant handle that setup? the frame needs to be "prepared" for that change too?
You may be able to get a 9 or 10 speed sprocket cassette on your wheel, if you have a freehub style hub rather than an older style freewheel. Its a common misconception that cassettes with more sprockets are wider, so the hub needs to be narrower or the frame needs to be wider, but actually the sprockets are closer together. 8, 9, 10 and mountain bike 11 speed cassettes are all the same width. 

This does not mean you can convert your bike to 9 or 10 speed though. TL:DR - it's usually not cost effective to upgrade Tourney level bikes.

You would need to replace the cassette, rear derailleur, chain and shifters, very likely the  crankset, front derailleur and bottom bracket too. For 10 speed you would need to be at Shimano Deore. If you add in the special tools required, paying someone to install it all (or making the investment in learning how to do it yourself), you will find that the cost approaches that of a new bike.