Trouble understanding the poll function
You can think of the poll function as the bouncer that determines if the operator should be allowed to go on and process something. The return value of the poll function determines if the execute function is called. 

The poll in this case checks if the scene has an active_object, if it does then context.active_object will evaluate to True, and therefore be not None or (different syntax same meaning) != None. 

The LocX function here doesn't even use the context parameter that was passed. The same could have been written this way:

def LocX():
    for i in bpy.context.selected_objects:
        i.location.x = bpy.context.active_object.location.x

....

@classmethod
def poll(cls, context):
    return context.active_object != None

def execute(self, context):
    LocX()
    return {'FINISHED'}


or this way

def LocX(context):
    for i in context.selected_objects:
        i.location.x = context.active_object.location.x

....

@classmethod
def poll(cls, context):
    return context.active_object != None

def execute(self, context):
    LocX(context)
    return {'FINISHED'}


The for-loop in LocX loops over the collection of selected_objects and for each object therein sets its location.x to be the same as active_object.location.x.



An aside

As a convention we tend to use o or ob or obj for temporary references to objects. i is usually (again this is a convention) used for numbers, integers, indices.