If we have the map of an environment (an occupancy grid for instance) and precisely know the pose of the robot within it. How can one reconstruct what the laser scan should look like at a given location ?
This would depend on how your map is formed in the first place. Is it saved by aggregating several scans into one map? If so, it'd be very hard to extract individual scans since this information is lost in the registration and subsequent aggregation. You can however, use a filter (eg: radius filter, crop box, etc.) to query the map based on your current pose and extract a portion of the map. This wont give you an individual scan but will be close.
The other option would be to skip the aggregation step and save individual scans with their poses. You will have to write a script to merge them at runtime and view/show a complete map, but no information is lost in the process. Extracting a scan would then be easy, as you just find the scan with the lowest distance between the current pose and one saved in the files.