Nominalization is making another part of speech--verbs, adjectives, phrases, abstract nouns, etc.--noun-like. Nominalization is mainly done with the help of 形式名詞 (nominal/dummy nouns).
The nominalizers の and こと are interchangeable in making other parts of speech noun-like to an extent. The main difference is that the former is more subjective and the latter is more objective.
Orthography Note: こと is usually not written as 事, but is frequently so in contexts in which it is more concrete as well as for all instances in older documents.
Seeing is believing.
Is this the first time you two have met?
I just noticed that Canada is cold.
I just realized that Canada is cold enough for penguins to even live.
Objectivity/subjectivity, although often a part of the equation, may not be the most important thing at work. In the following sentences, の just acts as a dummy noun for something else, but こと is more concrete, referring specifically to a situation. However, one can say that this is related to subjectivity being related to abstractness and objectivity being related to concreteness.
What sort of thing did you listen to?
What sort of thing did you hear/ask?
In the first sentence のreplaces some noun such as 曲. In the second, こと refers to a situation (状態). The response could be something like the following.
I heard/asked that/whether he went to Kyoto.
Lastly, こと can follow other nouns, のこと. This is very common with pronouns, and although it seems like a filler word to English speakers, think of how this would emphasis person in sentences like this one.
Do you like me?
Below are more examples to help you sort out differences between the two.
I didn't know that he is a famous musician.
10. あたし、そんなことはいわんかったわ。(Feminine; dialectical)
I didn't say anything like that!
11. もう一つ君に尋ねたいことがある。 (Male)
There's another thing I'd like to ask you about.
Speech Note: To a teacher say something more respectful like 先生、もう一つ伺いたいことがあるんですけれども（よろしいですか）。
Could you tell me what you saw?
The couple stopped dancing the samba together.
It seems that going for a walk every day is very good for your health.
I've known that she came home late last night.
You took her at her word, didn't you?
Is anything bothering you?
Breathing fresh air is wonderful.
It sure is wise to think about the future?
I saw the suspect come out flustered from the room.
It's not good to come to class without having done our homework.
I was born and raised in New York.
Usage Note: It may be the case that の is used in place of a thing, person, or place. In this case の refers to the city that the speaker was raised in.
It took a lot of time to find her phone number.
It'll be convenient for trips, won't it?
Grammar Note: （の）に can be followed by expressions that indicate purpose just as in the last two examples.
Since I had given up singing, being able to debut by chance was very delightful.
Receiving an education is important.
You can't doubt that there are police here now.
No matter what they say, I don't think that Japan was able to become an economic power thanks to America.
It is difficult to earn money by simple labor.
I was born in China, but my nationality is Indonesian.
It's evident that we clearly look over the information once more.
Phrase Note: 目を通す ＝ To look/scan over.
もの nominalizes something to show that something is undoubtedly true.
Oil floats on water.
I want to become a puppy!
I used to swim in the sea on Fridays, you know.
Phrase Note: よく…たものだ ＝ Used to.
Contraction Note: もの may be seen colloquially as もん.
Origin Note: もの comes from the noun 物.
もの can be anything. This もの can be in particle constructions like above. 物 is a tangible and perhaps living thing. It can even be a spiritual force. It's in many set expressions. It can even be used as a prefix. 者 refers to a person humbly or in a condescending manner.
To be possessed by an evil spirit.
People may be offended by the way you speak.
A sensible person
In no more than a few minutes.
Least said, soonest mended.
To get flustered.
With great success
To let something speak for itself.
First come, first served.
For as long as one can remember
Definition Note: 物心 ＝ Matter and mind; 物心 ＝ Discretion