A fastener’s diameter, length, thread pattern, head style, material, and strength can all matter. Thread pitch describes the distance between threads in a metric specification; threads per inch describes how many threads fit into one inch in a U.S. specification. A fastener that looks close may still be the wrong size or thread.
Practical boundary: bring the original fastener, a measurement, or the manufacturer’s specification when matching hardware. Do not force a nut or bolt that does not thread smoothly, and do not treat a visual match as proof of compatibility for structural, automotive, pressure, or safety-critical work.