Why "dimensions" attribute is not working on blender 2.8?
You're referring to multiple objects, which altogether have no attribute "dimensions". Each individual object has, though: 

for obj in bpy.context.scene.objects: 
    dimX, dimY, dimZ = obj.dimensions
    multiple = 5/dimZ
    obj.dimensions = (dimX * multiple, dimY * multiple, 5)


Be aware that division by zero could be an issue. Also I'm not sure if all objects have dimensions (cameras?). You could add if obj.type != "MESH" or dimZ == 0: continue as the second line of your forloop.