Hi Lu,
yes it is correct if you use it in situations in which there are 2 choices.
For example: "We're going to have a picnic, no matter whether it rains or shines" (if there will be 1. rain or 2. sun).
The word "if" is very similar to the word "whether", but with "whether", there has to be a choice of 2 things, whereas "if" can be used even if there is only one element involved.
For example: "We're going to have a picnic, no matter if it rains".
I hope this helps you :-)