In a 24 × 24 viewBox, a rectangle beginning at x=0 with a 2-unit stroke extends to x=−1. For a frame that must fit inside the box, put the rectangle at (1,1) and use width and height 22.
Export at the intended icon size and compare all four sides. If a mitered corner still clips, inspect the corner join or give the artwork more padding.