If two people are in a box (no windows) One is on the earth at 1G gravity and the other one is Accelerating in space with only the acceleration (inertial equal to 1G gravity) is there a way for the man inside the box to tell if he's on the earth or accelerating in space
@OrganicMarble's answer is correct. An absolutely uniform gravity field would require infinite mass at infinite distance and so realistic gravity fields will usually have local gradients that can be measured with sufficiently sensitive equipment. There might be some pathological situations where higher terms also cancel and gravity appears extremely uniform, but that's best left as another question.
Although it is not named explicitly, the question refers to the Equivalence Principle:
In the theory of general relativity, the equivalence principle is any of several related concepts dealing with the equivalence of gravitational (mass) and inertial mass, and to Albert Einstein's observation that the gravitational "force" as experienced locally while standing on a massive body (such as the Earth) is the same as the [pseudo-force] experienced by an observer in a non-inertial (accelerated) frame of reference.
The problem here is that the Earth is rotating, and so the Earth-box is not in an inertial frame to begin with.
One way this would be noticeable would be to look for non-inertial effects such as the precession of a Foucault pendulum. However, at the equator that precession goes to zero.
Another way to notice it would be in the motion of a simple gyroscope. For example, at the equator, a gyroscope initially spinning with a vertical axis would rotate in a vertical plane once a day. If it pointed "up" at noon, it would point "west" about six hours later, and "down" another six hours after that. Of course if you were not on the equator, or the initial direction were not "up", the motion would be more complex, but still indicate clearly that you were not in an inertial frame, except in the particular situation that you were at the North Pole and the initial direction were "up", or that it were at some orientation that coincided with the Earth's axis no matter where you were.
So to be absolutely sure, you probably should use the gyroscope with several initial directions, or combine the gyroscope with the Foucault pendulum.
above: Foucault Pendulum animation, from here.
above: Gyroscope animation, from here.
With sufficiently precise instruments* you can tell which box you are in because the Earth-based box gravity vectors will point to the center of the earth as you move about in the box (box on the left) whereas the space box will have parallel acceleration vectors (box on the right)
* probably not achievable in practice for a reasonably sized box but this is a thought experiment after all.
Both gravity fields are not totally equal. In the box on Earth, gravity at top is a little smaller than at the bottom. But in the other box gravity is the same at bottom and top.
There are ultra precise atomic clocks that show a very small difference in frequency when mounted at different heights and there are gravimeters with very high sensitivity. The relative time difference is -1,09 · 10-16 per meter of height.
On Earth the gravity decreases with every meter of increased height by 3.1 µm/s² (https://de.wikipedia.org/wiki/Schwerefeld and https://en.wikipedia.org/wiki/Gravity_of_Earth#Free_air_correction). The best superconducting gravimeters have a resoultion of 0.1 nm/s² (https://www.bkg.bund.de/DE/Observatorium-Wettzell/Messsysteme-Wettzell/Lokale-Messsysteme/Gravimeter/gravimeter_cont.html). Such gravimeters are also able to measure the influence of tidal effects of Moon and Sun to the Earth, but only in the box on earth tidal effects will be measureable.
A modern seismometer will show if there are the typical seismic waves of the Earth or completely different vibrations of a rocket in space.