Yes, dogs can eat pineapple! Many sources say pineapple is safe for dogs, if the theme of small amounts is followed it’s probably fine, but pineapple does have a lot of sugar in it.
Red fully ripened tomato in small amounts might be OK for your dog, however a warning about tomato is that it contains something called solanine which is present in the green leafy bits and possibly the unripened fruit of a tomato.
There are some human foods that are OK to offer to our four legged friends as a small treat, and others that are downright dangerous. When in doubt, run the question past your veterinarian, but here are a few rough guidelines to start the conversation.