This is known as back feeding, and while it’s physically possible, it’s a good way to kill someone or destroy something expensive. It’s frequently illegal because an electrical company technician working to get the power back on might be exposed to a live feed from your generator when they expect to be working on a deadline.