Loperamide is the only over the counter opiate (That I know of in the United States. Might be others, don't know.) It is marketed as Imodium and used for as an antidiarrheal.
There are over the counter medications available that can help arthritis. These medications generally help improve inflammation. The best option, however, is to seek medical advice from a doctor.