This is an interesting question with a tricky answer. The answer is that in everyday English, they can be synonyms. But in strictly correct English, they shouldn't be.
"Excuse" is easy. An "excuse" is a good reason for doing something wrong. If you have an excuse, then you will be forgiven.
A: "Why didn't you get the groceries?"
B: "I have an excuse! The supermarket was closed! We forgot that it closed early today, because of the holiday."
A: "Why didn't you bring your homework? What's your excuse?"
B: "The dog ate my homework."
A: "That's the worst excuse I've ever heard. I don't believe it."
"Alibi" is tricky. It has two meanings. Both are in the dictionary so they are both valid. One is formal, one is informal meaning.
In everyday life, "alibi" is sometimes used as a synonym for "excuse." It's a common use. But many people feel that it is not really correct to use it that way.
Legally, an "alibi" is a proof that you couldn't have committed a crime because you were somewhere else at the time of the crime.
A: "The murder was committed at 7 pm."
B: "I have an alibi. My girlfriend will swear that at 7 pm that evening, we were having dinner together at a restaurant."
If you have an "alibi," you won't be found guilty of a crime.
If you have an "excuse," you will be forgiven for something wrong you did.
They are not really the same, because an "alibi" means "proof that you were somewhere else when the crime was committed. But, as I say, in casual, colloquial speech an "excuse" is sometimes called an "alibi."