Following the owner's manual guidelines for running a generator, the answer can be "yes." Many contractors safely operate their work generators in truck beds or on trailers.  In addition, you can run portable generators from truck beds for RV or outdoor use.  The key is to follow all safety and operating guidelines from the generator manufacturer per the operating manual.