One way I’ve used it: suppose you register a hook to track something about the output of every layer in a network. But if you also want track this statistic for the input to the network, but not the input to any other layer, you have some inconvenient if statements to write.
Instead, just create a dummy layer at the start of the network (or wherever is useful):
def foo(module, input, ouput):
    # do something with 'output' only
    return


class Network(nn.Module):

    def __init__(self, ...):
        self.Input = nn.Identity()
        ...

        for name, layer in self.named_children():
            layer.register_forward_hook(foo)

    def forward(self, x):
        y = self.Input(x)
   
        # do stuff with 'y'
        ...