Go to File >> New to make a new image in Photoshop and make the image 2×2 pixels.
Then zoom in as far as you want; using the Pencil Tool (B) and using the color Black, make your image as mine.
Then go to Edit >> Define Pattern and name it Dots.
Now open up the picture you want to add a dotted border to in Photoshop.
If your image as multiple layers, go to Layer >> Flatten Image.
Now go to your Layers Palette, if your Layers Palette is not out then click F7. Double-click on the Background Layer and this should show up. Click OK and the Background Layer should turn to Layer 0.
Go to Layer >> Layer Style >> Stroke and make your settings as mine.
Click OK and you’re done!