Is it good practice to show notification on error?
Yes, it is a good practice to show a notification if an error occurs.
Example: User tries to login, but login fails because of server error (not talking about validation error, they are shown under text fields.)
Yes, if anything can be done from the user's side to fix the issue (like refreshing a web page).
Another example: Saving some data is completed.
Yes, for an instance, if is a large file that takes time to be uploaded.
Otherwise, just keep in mind, that showing too much notifications on regular tasks completion is not a good practice.
In general, a situation presented in the screenshot below should be avoided.

Unless, you're hosting a notifications demo site.