If the vehicle meets the standards below, the driver can be in the cab. Otherwise OSHA recommends standing away from the work being done:
1926.651(e)
Exposure to falling loads. No employee shall be permitted underneath loads handled by lifting or digging equipment. Employees shall be required to stand away from any vehicle being loaded or unloaded to avoid being struck by any spillage or falling materials. Operators may remain in the cabs of vehicles being loaded or unloaded when the vehicles are equipped, in accordance with 1926.601(b)(6), to provide adequate protection for the operator during loading and unloading operations.
http://www.osha.gov/pls/oshaweb/owadisp.show_document?p_table=STANDARD S&p_id=10775
1926.601(b)(6)
All haulage vehicles, whose pay load is loaded by means of cranes, power shovels, loaders, or similar equipment, shall have a cab shield and/or canopy adequate to protect the operator from shifting or falling materials.
http://www.osha.gov/pls/oshaweb/owadisp.show_document?p_table=STANDARD S&p_id=10768


