In the United States, the answer is a very clear "No" almost everywhere - those plug in inverters aren't permitted under NEC. Power companies generally require you to have interconnect agreements for any amount of self generation that could interact with the grid (off grid system, have at it, it touches the house wiring, you need to talk to them).
The problem with plugging that sort of thing into a random outlet is that now you've violated the assumptions on the circuit protection. If you have a string of outlets, protected at 20A at the panel, then nothing plugged into any one outlet can pull more than 20A sustained (or the breaker will pop), and the wiring will never see more than 20A sustained.
If you plug in another source at the far end of that circuit, outlets in the middle and branches off the main wiring run could be seeing 30A without popping a breaker - and that's a fire hazard. A 20A outlet won't pass 30A forever, and wiring rated for 20A can overheat at 30A sustained.
In some other countries, you can install some amount of solar and backfeed it like that, but I'm not familiar with those regulations, not living there.