From what I understand the effect is detrimental to their teeth if they have no hay but only pellets. The grinding action of the hay keeps their teeth trimmed because it is harder and takes longer to eat. That is one reason why chinchillas with tooth problems stop eating hay. Not always but usually that is the case. Most chinchillas will eat a small handful of hay each day as well as about two tablespoons of pellets when given an unlimited amount of each.
If your chinchilla's teeth do not get properly trimmed each day they will overgrow resulting in malocclusion which is usually not possible to cure.
Opposite of that (having no pellets and only hay) is not detrimental per se, but the pellets have the added benefit of extra nutrients and will keep their weight higher which gives them extra insurance if they have to deal with sickness. A loose-hay only diet requires alfalfa hay to be given since timothy is not as nutrient rich.
It is recommended to supply your pets with both hay and pellets but the pellets must be the proper quality. If they are sweet or too soft your pet may go off its hay and overeat the pellets. Many diets marketed towards chinchillas are not good and some are very unhealthy. There are some good ones out there.