If you dub your closet a "utility" closet (and not put anything combustable in there...) then you may...
But if you intend to use it as a clothes closet, you may not.
240-24(d) Not in Vicinity of Easily Ignited Material. Overcurrent devices shall not be located in the vicinity of easily ignited material, such as in clothes closets.