Call a function when new node link is created
If you are writing your own nodes:
Yes! You can add an update-function wich can handle input-tests.
Your update-function will be called on every change of the node, so on linking/unlinking it will be called. Here is how:

class MyNode(bpy.types.Node):
    bl_idname='MyNode'
    bl_label ='MyNode'
    # your update function must only take self
    def update(self):
        # your code here
        for skt in self.inputs:
            if skt.links:
                print("Input socket {} is linked".format(skt.name))


If you are using existent nodes:
No, probably not. You simply can not overwrite the nodes own update-functions.
They seem to be like a read-only-property returning a function to you.
Setting them wont work, no matter what.