Yes, the use of the same symbol "d" can be a bit confusing for students.
When we analyse the diffraction pattern produced by a single slit, then d is the symbol given to the width of the slit. As light passes through a single slit, it creates a single bright band accompanied by diffraction fringes on the left and right sides.
When we analyse the diffraction pattern produced by multiple slits (e.g. a diffraction grating), then d is the symbol given to the spacing between the slits. A diffraction grating creates an extended pattern of bright and dark fringes.