If you have a template grid with entities Foo, with an on click microflow defined, then you can simply add a parameter of type Foo to your microflow and Mendix will pass the clicked entity.
You can have a default button trigger and within Template grid, you can add buttons and mark a button as a default button.
So, when a record with in template grid is double clicked, then the microflow behind the button is automatically executed.
But if you want to know, which nth record is clicked, then it is not possible to know.
I would wonder, why would you even need to know that actually.