Can you put an electrical switch inside a walk-in closet according to NEC?
Code doesn’t specify a location for the light switch it can be inside or outside so a code reference is not available.
The only limit is the height at 6’7”
NEC 410 can get you started for luminaries and closets 410.16 in the closet then 410.48 general wiring but no requirement for the location.
More on switches in article 404 And again the height max is the only limit.