Yes and no. In the tourist hot-spots of cities such as Madrid, Barcelona & Málaga, which means the historic centres it is probably best to forget about it - all have freezes and no new short-term letting licences will be issued for the foreseeable future. Away from the cities, in general it is possible but if you buy a property without an existing licence you will have to get permission from the Community of Owners to do so. They can refuse and, in addition, many Communities are seeking to get this type of rental banned at the Annual General Meeting.
However, a recent ruling by the regional government in Andalucía, the Junta, has clarified a couple of points which helps buyers in that region. They ruled that a licence is granted to a property that meets the regulations, not an individual, and therefore, an existing licence stays with the property and a new owner may let short-term if they wish. Furthermore, any subsequent ban by a Community of Owners does not cancel a tourist rental licence providing the licence predates the ban.
Nevertheless, it's important to keep up-to-date with what's going on in the tourist letting sector if it is relevant to your property criteria as this ruling can be appealed and may fall. If it stands, I would expect prices of properties with a letting licence to rise and other regions to follow suit.