Put the parts in order:
frame eyelet
Rack stay
Fender stay
washer
Bolt.
This reduces leverage by the heavily loaded rack on the bolt.
On some frames, the bolt may work its way out, even when tightened, due to some weird mechanical process which looks like vodoo. I had this happen a few times on my Al frame. The solution is to replace the plain washer with a seratted, anti-rotation star washer.
I would only use an additional Nylock nut on frames with plain, unthreaded eyelets.
You need a bolt long enough to protrude a couple of threads but not so long as to interfere with the chain. Stainless steel M5 allen bolts from any hardware store are best. Many racks and fenders come with low-grade bolts.