Can I use a 30 amp generator to power some parts of a 60 amp subpanel
Yes, if you make sure to shut down enough things (if not, you'll trip breakers, so you are still good, from the safe and effective front.) I have a 40 amp manual generator interlock installed in a 200 amp panel. I neither need nor want a generator big enough to run everything at once, or automatic switching. I do want (and I have) the ability to power any one thing (or combination of things) that the generator can safely supply, without having to fool around with hack rewiring jobs under poor conditions or absurd extension cord tricks. That panel will eventually have a 100 amp feed to another building, and the generator input will be able to feed it (so long as the actual draw over there is controlled to be below the generator output, of course.)

Exactly what your options are will depend on exactly what your panels are, and what the panel maker has for approved interlock devices, but generically, it is possible. The legal and important safety end of "safe and legal" is having the interlock so you absolutely, positively, cannot backfeed power to the grid. The overcurrent part of safe will be taken care of by the generator output breaker and/or the panel input breaker for the interlock. Obviously the 60 amp breaker will be highly unlikely to trip if a 30 amp generator is feeding it - but if you draw 40 amps for some reason, the generator breaker will trip. The 60 amp rated wiring will of course be just fine with 30 or less amps running on it.