I want to do some operations when user closes the app.
That is not possible. Your process is simply terminated, with no notice.
Isn't there anything like onApplicationDestroy()?
No.
Is is possible to make connection with server and pass some values when user closes app in this way?
No.
Note that there is nothing significantly different between the user swiping your app off the recent-tasks list (what you depict in your question) and various other scenarios, including:
Android terminating your background process to free up memory for other applications
Users terminating your background process using a third-party task maanger