There have been a number of studies over the years looking at the relationship between breastfeeding and the prevalence of asthma. There is no consensus view with some saying there is a benefit in breastfeeding, and that breastfeeding does reduce the likelihood of asthma and others and other saying there no benefit.
A good article by Guilbert TW, Wright AL Does breastfeeding impact lung function and asthma risk? Am J Respir Crit Care Med. 2012 Apr 15;185(8):801-2. doi: 10.1164 / rccm.201202-0239ED is reported at https://www.atsjournals.org/doi/full/10.1164/rccm.201202-0239ED
To quote from this report “The relation of infant feeding to later pulmonary function continues to be controversial. What is not controversial is that breastfeeding provides many benefits to the infant—developmental, nutritional, and immunological.”