What is the difference between "end" and "end)"
Nothing.
end is still a statement to declare the end of some sort of structure. Like a function, if statement, loop, etc...
The ending parenthesis is simply there to close an argument list.
script.Parent.Touched:Connect(function(p) if p.Name == "Dog" then print("We touched a dog") end -- End to close the if statement end) -- End and then a closing parenthesis to close the argument list of Connect