In a word, you can, but not the best way. It would require a couple of steps (turning off multiple breakers)each time you were not on shore power or generator.
You only want those circuits that you want to be able to run on the inverter on the "output" side of the inverter. Certainly NOT things like roof A/C, 120 VAC water heater element, converter, etc. Doing it like you suggest would REQUIRE (so batteries are not discharged rapidly and/or appliances or inverter overloaded) that you turn off all the individual breakers to all those devices you do not want powered by the inverter every time the generator is not running/shore power connected.
Best way is to wire inverter output to a sub-panel with only those things you want to be powered by the inverter when not on shore power.
So, can it be done-- Yes, but there ARE better ways.