No the check engine light does not actually have to be illuminated to pull codes from the vehicles computer with the right diagnostic tools and equipment.
I've had Autozone staff and Oreillyauto staff tell me they couldn't check the check engine light without it being on which is true for them.
But a good auto mechanic and good auto shop that has the right diagnostic tools can pull the codes from your vehicles computer without the check engine light being on.
A good mechanic shop should have some expensive equipment to diagnose the reason that the check engine light is coming on and can do a better test of your vehicles check engine light than an auto parts store can do.