Could a medieval town have been built on the desert facing side of a mountain range? Not a Himalaya size mountain, but definitely at least Rocky Mountain size. It's a big desert and is one of the reasons that a nearby empire stopped pushing that direction. I want the town to be somewhat of a border town/outpost, but I want its existence to be practical and not just random.
Absolutely possible. Really do need to know how many people you want to support. A typical Medieval town can range greatly in population, but this could certainly support a few hundred people. Take a look at the answers to this question right here on stack exchange.
As long as you have the basics, food, water, and all that it's certainly possible.
Because it's right by a mountain range, water might actually flow through this area, and it's even better if you have a spring.
Just because an area is desert doesn't mean that there isn't a water supply present. They should be able to grow or trade for food.
The mountains are really the only difference between your question and the other (which is actually marked Medieval in the tags).
To answer the population question, take a look at this question, which is about how far apart Medieval cities tend to be, but my answer there covers population as well. Keep in mind that the conditions you outline would mean that it might be far from other cities/townships but the next small town could be situated in the valley through the pass. Because conditions for farming aren't as good, naturally your town is going to be further away from other places--more like the 10 mile limit in Giant Cow's answer. And there probably won't be anything out further if there's a lack of resources.
The other thing you might want is...something on the other side of the desert that people want to get to. It's a good reason for your outpost to exist. That something can be trade with another nation or something else entirely.
Desert conditions vary widely--so it doesn't have to be your classic Sahara-- or it can have a transition to different types of desert. See this link for more info.
Your city can be an oasis on a trade route. Travelers going one direction are about to brave the desert after making it through the mountains. Travelers having made it through the desert need to get through the mountains next. Either way these travelers need someplace to rest and change up their gear for the next leg of the trip.
On the ancient Silk Road, the city of Kashgar was this place. https://www.britannica.com/place/Kashgar
Kashgar lies at the western end of the Tarim Basin, in a fertile oasis of loess (silt deposited by the wind) and alluvial soils watered by the Kaxgar (Kashgar) River and by a series of wells. The climate of the area is extremely arid, with variable precipitation averaging about 3 inches (75 mm) per year (most falling as rain during the hot summer months). Kashgar’s historical importance has been primarily as a trading centre. Situated at the foot of the Pamirs (mountains) where the ranges of the Tien Shan and the Kunlun Mountains join, Kashgar commanded historical caravan routes—notably the famed Silk Road westward to Europe via the Fergana Valley of present-day Uzbekistan, as well as routes going south to the Kashmir region and north to Ürümqi (Urumchi) and the Ili (Yili) River valley.
Kashgar is in the rain shadow of 2 different mountain ranges but has water, probably ground water originating in the mountains. That fact and its site on the confluence of trade routes are the reason for its location.
Whyever not? For instance places like Petra https://en.wikipedia.org/wiki/Petra which long predates the medieval era. Or all the pioneer towns on the east side of the Sierra Nevada (North America), most of them built with tech that wasn't that much beyond medieval.
You just need to be selective in your location. The town will need to be located on a water source, an oasis or system bringing water down from the high-elevation snowpack. (And these can be rivers of moderate size, e.g. the Truckee, Carson, & Walker rivers on the east side of the Sierra.) Then for any sort of major town, you need something like trade routes and/or mineral wealth to provide a reason for more than subsistence farming/herding.
Yes. With "desert facing side" you are implying the desert is in the rain shadow of the mountains and that means it rains on the mountains. Which means there is useable amount of water running down from them. Most of the water rains on the other side, but there should be ground water available and probably even small rivers running to salt lakes or flats.
So the particular area might have enough water to support irrigation and have a fairly large population. It might have a large urban population of craftsmen as well as it would probably be the ending point of any trade routes across the desert as one of the few areas of plentiful food and water on the "near side."
Desert is defined by amount of rainfall received in a given year. (<10 inches, I believe).
Water can be quite abundant in aquifers underneath deserts. Here's one example - there are plenty more.
The answer to your question is yes.
Look at the Front Range of Colorado. Not a desert, but it gives you good parallels.
If the mountains are RIGHT THERE, you have access to the water, vegetation, habitat for animals... traveling along the mountains on the desert side is easier, you can see for a very long way... so you have feasibility and a good reason to be there... harder to defend if invaded from the mountain side, but probably not to detrimental. Its seems practical and reasonable.
Simply being an entrepot on the frontier of an empire is economic reason enough to support a town or even a significant city.
Just because it is on the dry side of the range doesn't mean that it has no water. Unless the range is a monolithic wall, it is easily possible that a major river flows though a gap and away down the dry side.
The desert could be like Egypt with a single river flowing through it forming a single corridor of trade and communication with your town at it's head.
The desert may well be a practical obstacle for the empire, but it doesn't mean no-one crosses the desert - it just means there's no incentive for the empire to own it. It can still be the empire end of a trade route, and as such it's a perfectly sensible place for a city to develop.
Of course you need there to be no strong incentive for the empire to cross the desert, meaning the country on the other side should be at least neutral or ideally friendly. It's probably a good idea for both sides to have things that each other would like, so that it's not all one-way traffic.