Examples of primary substances are animals, apples, trees, and mountains. Secondary matter is comparable to form. This is to say that secondary matter is "said of" or "inhering in" a primary substance. So, a tree (primary substance) is tall (secondary substance). The leaves (primary) are green (secondary). The two substances, primary and secondary, depend on each other to be (to exist, ontologically). A tree can not "be" unless it manifests in a certain form, shape, color, weight (all secondary substances). A color can not physically "be" unless it is said of, or inheres in, a primary thing. In this way of thinking, primary substances can change physically by aging, changing color, changing size, shape, and so on.
When Aristotle speaks of primary substances not changing ontologically, he is referring to the abstract idea of them. That is to say that there is a branch of thinking (metaphysics - "first philosophy") that deals with eternal things. So, a dog or a chair (primary) can physically change, but the abstract idea does not. This is comparable to Plato's Ideal Forms. To make it more clear, choose a primary substance and try to explain ways in which it can not change. A dog can get older, larger, smaller, painted blue, and so on. But what is it about a dog's being (ontology) that does not change? Dogs are animals, with a certain body structure, abilities, and so on. Or, to use Plato's example, a chair can be large, small, blue, red, etc. But most chairs have four legs (some have three), most are used to sit on, etc. The discussion of more complex primaries such as humans and abstract concepts like "love" or "justice" are a bit more difficult, but the same method is used. The Greeks were interested in this dichotomy of changing, physical substance and the eternal, unchanging idea of them: what their being (ontology) is.