Use of decision trees for classifying images
Yes, you can use decision trees or random forests for this task and this was even the state-of-the-art approach until the early/mid 2010's. For example, here is a paper from 2010 in which exactly this was done. Nowadays, we use convolutional neural networks (CNN's) as they usually yield a higher accuracy and are more convenient to train, as long as you have a lot of images and decent computational ressources.

The most convenient thing about CNN's is that they implicitly create the features by themselves during the training process, while other machine learning techniques, e.g. decision trees, require you to create a set of features beforehand.

For example, in the referenced paper, the authors had to generate the local binary patterns of the images and then used them to train their decision tree. With a CNN they would have simply used the original images and would most probably got a higher accuracy. However, note that they would have needed more images to train a CNN than to train a decision tree.