Is it safe to ground a portable generator using the house ground at the service panel?
The generator must get its ground from whichever main service panel it feeds (e.g. it could have its own main panel), which in turn must be grounded any way that's legal. If you are simply running extension cords to the generator, it must be grounded legally. 

It's legal to share grounds.  You do that by running your own ground strap to the same pipe clamp, pipe or ground rod.  You cannot go inside the other panel.  

If generator power is entering the same service panel as utility power, then you absolutely must have some kind of transfer switch, which makes it impossible to have both utility service and generator connected at once. 

The transfer switch can be as simple as two 240V breakers with a piece of sliding metal so they can't both be on at the same time.  No big deal. 
https://www.google.com/search?q=panel+transfer+interlock&amp;rls=en&amp;tbm=isch&amp;sa=X