Stimulus generalization: In psychology, the term stimulus generalization is described in the conditioning process as the propensity of a conditioned stimulus to give rise to the same responses once the response is being conditioned.
Generally, a subject involved in stimulus generalization responds to the alike stimulus similarly yet not identical to the former or original conditioned stimulus. It can be used in operant conditioning as well as classical conditioning.
Example: As given in the question above, due to his previous experience with the dog, Alex response similar to he sees any other dog.
Because a lot of things have not yet been discovered and questioned as well as there being billions of things that we have absolutely no knowledge about.