I think of optical illusions as things which can be very clear to see, but they are not persistent. You might be able to see something that is not really there, but if you look directly at it, you can tell that it is not actually there because it goes away. For example, this black dot illusion in between the number keys:
You can see the dots when you are looking at other places, but they are never located where you are actually looking. If you look only at one place between specific keys, such as the central space located in the middle of keys 4, 5, 7, 8, you can prove to yourself that the dot is not really there.
The pupil effect is 100% persistent in my case where the lighting happens to be ideal. I can look directly at one pupil of one of my eyes in the mirror, and the black dot never goes away. So, in that sense, it is difficult for me to say it is an optical illusion.
However, I do understand that the black dot is not really there. There is actually a flowing water stream in front of the pupil, but for some unknown reason the water stream does not show up visibly in that one place, and there is a black dot instead. So, yes, it is some kind of illusion, at least in that the black dot is not really something that is there. But the same could be said about a rainbow in the sky. It is not a real thing that is there, it is an optical phenomenon, but it is hard for me to call it an optical illusion, because it is persistent.
I wonder if you were able to see the dot persistently, or if you only caught a fleeting glimpse of it due to your lighting not being ideal? If so, then I can understand why you might call it an optical illusion, because it might seem to be just like the dot illusion in the image above. But if you could see the dot persistently, would you still call it an illusion?