Is it fine to send a message to the author of a paper if I don't understand something and want to clarify it?
By all means ask. A person who goes through the trouble of writing up lecture notes, is almost certainly a person who would be happy to answer.
As someone who receives a lot of questions from PhD students myself, here are a couple of pointers for how to phrase your question. This could be obvious to you, but I know for sure that it is not obvious for everybody.
If you have a local supervisor, it makes sense to ask them first - maybe it is a trivial question.
Read the paper first, and use the notation from that paper when you can.
Cut to the chase as quickly as possible. Don't explain their paper back to them in the mail, they know what they wrote.
The author says to email them, so email them. You’re overthinking this. You would be using their publicly listed email address for exactly its intended purpose.
In general, people who prefer not to contacted by PhD students who have questions about their work will find a way to make that known or to avoid receiving such questions. Leave it to those people (who don’t really exist, by the way) to worry about such things for themselves.
I agree with all the other posters. (Go ahead, ask!) Two additional points:
You might not get a response; sometimes, non-urgent emails get lost in the shuffle. (Especially now, with the sudden shift to online teaching.) If this happens, try not to worry about it.
I'd avoid the word "doubt". It suggests (to me, anyway) that you believe there's a mistake in what the author wrote. Even if you do suspect this, it's still polite to write from the point of view that the misunderstanding is likely on your end. In the past, I've saved myself some embarrassment by doing this!