Same would be the case for avocados, watermelon, bananas, and pumpkins that are also classified as berries. Can they all be grafted onto one another?
No, you can not graft a pineapple to another "berry" tree. This is because the fruit name "berry" is merely a botanical term for a "type of fruit" that the plant produces. The term "berry" has nothing to do with how related the plants are to each other.
There are dozens of botanical terms for "different types of fruits". But, not to be overly technical, these different terms are only given to describe what parts of the "pericarp" develop into what we commonly refer to as the fruit of the plant. They do not describe anything about how the plants are related to each other. Only plants closely related to each other can be grafted together. Here are a couple of botanical terminology links that provide more detailed information.