Yes. Locking the roof access is allowed when the roof is not occupied. Such a lock keeps unauthorized persons from passing to and from the roof. While the OSHA regulations are centered around door access, the same principles should also apply to roof hatches.
NFPA 101, Life Safety Code, says that doors to roofs either:
- Need to prevent access from the inside by locking, or
- Need to be able to be opened from the outside if someone were to go upstairs to a roof access point.
Generally, it is a safety concern when building occupants not intended to ever be on the roof are able to access to the roof. That "free" access could lead to someone entering through the roof which is a major facility security safety concern.
Many companies lock exterior access to roofs as well as stairways and ladders for liability purposes to prevent unauthorized persons from accessing the roof.