No, they are not mandatory and yes, you can decline.
However, if you have any differences with your employer this may be the only opportunity you have to get them on record.
Also, your employer is free to discuss what they may see as a failure to cooperate, with any prospective employers who call for references.
So while the law does not say you must participate in an exit interview, failure to do so, if your employer feels strongly enough about it, can have repercussions.