Most public school (practically all, with very few exceptions) have a school attendance area within that school district. Parents have to choose a public school for their kids when residing in that particular school attendance area. No Choice. You may not pick and chose public schools in other attendance area, or in other school districts. There are extremely few exceptions, where public schools have an open enrollment area but once again restricted to within a school district. Some public school are know to check and verify on the residential addresses.
Before you make an offer, speak with the local school district and check on the public school attendance areas and any acceptable variations to the law.
This is one subject you need to work on your own, may speak to your realtor, but you and you only need to figure it out.
I could help direct you to the right answer.
Schools are assigned based on the residence address. You cannot choose a school within the district, which is why some homes can be priced higher--better school districts and API scores. Check with the school district to determine the precise schools serving ny home for which you have an interest in purchasing.