Ironically, one of the things that makes learning English tense challenging is the fact we have fairly few forms. Also, the question "is this grammatical" is tough to answer for short utterances without context, as we can almost always come up with some scenario when a native speaker might say it and be understood by other native speakers without anyone noticing anything out of place. A better question is "Does this mean what I think it means" and "Is this what native speakers would say."
So with that in mind, let me actually answer the question you asked!
These two sentences are very similar, so it is not surprising that you would be confused. There is a subtle technical distinction, but the more important distinction is a difference in meaning, which I'll get to.
Is This Grammatical
"I'm sure that would happen"
Grammatically this is fine by itself. I would take it to mean someone has asked you what would happen given some specific circumstances, e.g.:
a. "If I ran naked down the street, would someone call the authorities?"
b. "I'm sure that would happen."
"I'm sure that will happen"
Again, grammatically this is fine by itself. To me the most obvious context would be someone is asking you about your prediction of future events. E.g.:
a. "If I run naked down the street, will I be arrested?"
b. "I'm sure that will happen."
Which Should I Use?
or, "What's the difference?"
Technical Difference
I intentionally chose two examples that are very close together to make a point about agreement, not so much between verbs but between speakers: in the first example, person A says "If I RAN down the street". That "ran" is expressing a hypothetical circumstance (I believe it's technically known as "conditional II" because it's using a past tense verb to indicate something counterfactual). So it is only natural that person B would reply treating it as a hypothetical circumstance, too. Person A didn't say he was going to do it, he just wondered what would happen if he did.
In the second example, person A says "If I RUN down the street". This could still be hypothetical; in fact it probably is, since people don't usually run naked down the street. But because it's being phrased as an action that the person is actually contemplating, it seems a little more natural for person B to respond with "will". But note: "I'm sure that would happen" would also be a perfectly appropriate response.
Semantic Difference
In all the examples I used, everyone is still talking about things that haven't happened. By definition, then, these are "imagined events or situations" like it says in your grammar book. The difference is really based on how definite or how likely the imagined events seem to the speakers. Someone who says "I will" is implying that their imagined event is going to become reality, in a way that someone who says "I would" is not.
If you have a more detailed context, we can probably give you more definite advice to distinguish between the two.
For further reading, please see https://en.wikipedia.org/wiki/English_conditional_sentences which discusses a LOT of different possible uses of conditional in English (with sentence patterns).
Another way of saying natural tendency is calling it proclivity, both will and its past equivalent would are used to express, what Michael Swan (Practical English Usage) describes, habits and characteristics
Will and would can be used to talk about repeated and habitual behaviour. Would refers to the past.
- When nobody's looking, she'll go into the kitchen and steal biscuits
- On Sundays, when I was a child, we would get up early and go fishing.
A.J.Thomson A.V.Martinet in their book A Practical English Grammar (4th Ed) explain this nicely, better than I could
Habits in the present are normally expressed by the simple present tense; but will + infinitive can be used instead when we wish to emphasize the characteristics of the performer rather than the action performed. It is chiefly used in general statements:
- An Englishman will usually show you the way in the street (It is normal for an Englishman to act in this way.)
This is not a very important use of will, but the past form, would, has a much wider use and can replace used to when we are describing a past routine.
- On Sundays he used to/would get up early and go fishing. He used to/would spend the whole day by the river and in the evening used to/would come home with marvellous stories of the fish he had nearly caught.
Thus saying that water will boil at 100°C is stating a general characteristic; a natural tendency: the general inclination of water when it is heated at that temperature. Using will in this way is uncommon, but it shows why its past equivalent, would, is often used to express repeated actions in the past. However, would and used to are not always interchangeable.
Examples:
Positive
- Italian middle schools used to teach Latin. = In Italy, Latin was taught at middle school.
- In Italy middle schools would teach Latin. = same meaning as above
BUT in the negative sense
- Italian middle schools didn't use to teach English. = In the past, English was never taught at middle school.
- Italian middle schools wouldn't teach English. = In the past, Italian middle schools refused/did not want to teach English.
In order for wouldn't to convey the same meaning as didn't use to, the adverb never could be employed.
- Italian middle schools would never teach English.
Other examples
As a child I didn't use to wear glasses because I had good eyesight = I didn't wear glasses as a child because my eyesight was good.
As a child I wouldn't wear glasses, although my eyesight was poor. = I refused to wear glasses when I was a child, even if my eyesight was not good. (different meaning)
As a child I would never wear glasses, although my eyesight was poor = similar meaning to 1.
Best Answer
The first example is a hypothetical, taking the subjunctive verbs would do and rained.
The second is about futurity -- the wedding is already scheduled -- so it takes the future in the main clause and the present indicative in the subordinate clause.