I am assuming you are in England and want a state schooolac.
Yes, you can apply to any school. But you need to be highly realistic about your chances of securing a place.
You apply through your home council, even if some of your preferences are in other boroughs, and the council coordinates with the other/s. The offer you receive will be the one you qualify for which you list highest on your form. If you qualify for none of your preferences, you will be allocated the closest school with a vacancy.
If a school is undersubscribed, then you will be offered a place.
But if there are more applicants than places available, the school has to follow its published over subscription criteria, typically (after the mandatory categories of LAC/SEN) this would be siblings in catchment, other catchment, other siblings, all others; in the category where the number of applicants exceeds the number of remaining places, then it will be by distance from the home address.
You need to look at your target schools and see what the 'greatest distance offered' was in your entry category. OK, past performance is no guarantee of the future, but if it's never been greater than 800m in the last 10 years, and you want to live 15 miles away, then youbare just not going to get a place.