can you go to your primary doctor to get referred to a specialist?

Just wondering if you can only be referred to a specialist by a obgyn or if you can get one from your primary doctor? And also, would you have to make an appointment to get a referral or can you just call and ask?