If you have had a medical illness or injury prior to applying for your medical insurance in Spain, then it will be excluded.
Spanish medical insurance companies do not require you to undertake a medical examination. They will ask you to complete a questionnaire. Using your answers their medical underwriters may feel they need more information. This might be just by way of follow up questions,. In some cases, they will want to see the medical reports of the previous treatment.
That does not mean you will not get medical insurance but your policy may have exclusions in it.
Let’s use an example to explain this. Assume that an applicant for medical insurance in Spain broke their left leg several years ago in a car accident. They underwent an operation at the local hospital. The person had several screws and a metal plate fitted to help with the recovery. A medical insurance company in Spain will probably not decline this person. They may, however, include an exclusion for anything related to this prior injury.
More serious conditions may result in the medical insurance company declining to provide any type of medical insurance cover for that individual.
Some serious medical conditions do not automatically mean you will not be insured. For example, if it was a long time ago and having had regular checks there have been no further problems, then an insurer may consider issuing a medical insurance policy.
With some international companies, with subsidiaries in both the UK and Spain for example, it is possible to transfer a policy. That way you could avoid both the grace period and problems of the pre-existing condition.
You will probably get your application for medical insurance in Spain approved. However, if you later need treatment and the company discovers you have not declared a condition there will be consequences. They will likely cancel the treatment and possibly the policy.
Whilst it is possible, it is unlikely that as we get older we have not had some illness or injury.