I've flown several times to Dubai with a major airline, and Sharjah was our alternate every time. Matter of fact, there's lots of places we go to where the alternate is within 20-40 nm from the destination. It all depends on the weather at the ETA.
In the same way, there's no limit to how far your alternate can be, as long as you carry enough fuel to go to it. However, carrying lots of fuel will make you burn more too due to the extra weight; so the closer the alternate is, the more economical it becomes in regards to fuel cost. That's why you'll often have the closest suitable airport as your alternate, weather permitting of course.