We might not know for certain that artificial gravity is impossible, but if it exists while maintaining the law of conservation of energy, it would have very strange characteristics. Arthur C. Clarke, in one of his White Hart stories, examined the issue from the opposite viewpoint of antigravity. Some experiment or accident (I forget the details) created a sphere (on Earth, near the ground) inside of which gravity was cancelled. But to get anything inside the sphere, due to conservation of energy, you had to shove it in with the same amount of energy it would take to accelerate that thing to escape velocity. And when anything moves out of the sphere, it instantly acquires escape velocity. Which got messy.
For artificial gravity, conservation of energy could require a lot of energy to turn the field on, depending on the nearby mass (e.g. the planet and/or star you're orbiting) and how much mass is inside the field. But Star Trek technology uses ridiculous amounts of energy anyhow (sometimes even on the order of one to the tenth power!).
Actually, there's no need for artificial gravity per se in Star Trek. Star Trek technology includes the capability to push and pull on things at a distance, acting proportionally on each particle of the thing pushed (when needed) instead of necessarily putting pressure on the thing's surface. Deflectors, tractor beams, "inertial compensators", "artificial gravity," and perhaps "holographic matter" all do basically that, in different directions for different situations.