Alter entity.user.canonical (/user/{uid}) route When a user (e.g. nid = 37) goes to some other user's profile page at a url like /user/1, /user/2, ..., /user/n, I want automatically redirect them to their own: /user/37 page. 

How can I do properly this with Drupal 8?

I think I must create a custom Controller Class and configure the default drupal route (/user/{uid}) adding my custom Controller, but I don't know how can I do this.
There are at least two ways you could pursue to do what you're trying to achieve:


You can alter routes using a RouteSubscriber.
Listen for a event (likely KernelEvents::REQUEST), and respond appropriately.


The RouteSubscriber is probably a bit hard to do (I haven't written one yet, I just discovered their existence the other day), but is more in keeping with the older hook_menu_alter patterns from previous versions of Drupal.

The EventSubscriber is probably easier to write once you understand the event system (which requires some learning but is where lots of the future of Drupal internals is headed).