Yes, your family medical history can affect your life insurance application.
If you have any direct family members who were diagnosed with cancer or heart disease before the age of 60, this could indicate a hereditary trait and therefore you will be seen as a higher risk by many insurers.
There are various other conditions that insurers will ask about when considering your family history, so it is best to be prepared to answer these questions when applying for life insurance.
If you potentially have a negative hereditary trait then this does not automatically disqualify you from getting life insurance, but your premium prices may be affected.
It is always important to disclose all known medical information at time of application, as withholding any information or knowledge could lead to any claim being invalid.