Some of this food could easily be toxic to humans, or vice versa, even if we are all biologically closely related. In the Star Trek universe then they have an underlying hypothesis that all the planets with the various humanoids on them were seeded by the Ancient humanoids, so it's reasonable that it is all using the same amino acids as Earth life. Could be the same if there's a common origin because e.g. the life originated on another planet around an earlier star that passed through the protoplanetary disks of the forming solar systems.
In Star Trek they go one step further (rather improbably) that the humanoids are so closely related they can actually interbreed, which would suggest that they can eat just about anything we can. Still, even then, they need to take some care. Humans vary a fair bit in their tolerance to foods and in allergic reactions that can be deadly. A Thanksgiving Look At Great Meals In Star Trek History