Of course you can. Just hold the ruler against the bridge of your nose and line up the middle of your left pupil with the 0 line of the ruler. You can now measure the distance between your pupils!
I recommend getting your eyes examined by a professional to make sure you get the right PD measurement. But the condition is limited, a ruler can help you with it.