Hello and welcome to the forum. I had similar problems with one of my dogs. I tried her on raw food for a short while but it wasn’t suitable. Although I am not blaming it entirely for her anal gland problem, it seemed to exacerbate it. This was an older dog who had never needed to have her anal glands emptied.
I suspect, but do not know for sure that the problem with raw food is that although the stool is firm, for some dogs there is insufficient bulk so the anal glands might not be compressed sufficiently as the faeces pass through. Your vet is right in suggesting brown rice because it is a good source of fibre. I switched all my dogs to cold pressed food that has circa 28% brown rice and my dog’s anal glands didn’t need emptying after that. In my dogs it produces a firm stool with sufficient bulk.
Regarding switching to wet food, it would hopefully help but check the amount of brown rice and fibre content. These can be found in the Dog Food Directory. My experience with some quality wet foods is that they can prolduce a small firm stool, not dissimilar to when fed raw food. It depends on how much brown rice it contains. For instance, Forthglade is 4% and is below average in fibre but it contains brown rice. Naturediet has 10% rice but they don’t say that it is brown rice. The fibre content is above average. However, you can always bulk up wet food with a little more well cooked brown rice and perhaps suitable vegetables. The latter should be cooked and puréed to aid digestion.