It depends on the ejection seat.
Modern zero-zero ejection seats are designed to be usable at zero speed, zero altitude.
Older ejection seats had different minimums which varied from model to model.
On a side note, the early F-104 ejection seats required quite a bit of altitude to deploy properly, since the pilot exited through the bottom of the aircraft.
This was done because there was some concern that the pilot would hit the F-104's T-tail with a standard ejection seat.
EDIT
It appears that it may actually be possible to eject from an inverted aircraft.
According to Wikipedia (bold added for emphasis): The minimal ejection altitude for ACES II seat in inverted flight is about 140 feet (43 m) above ground level at 150 KIAS.
While the Russian counterpart - K-36DM has the minimal ejection altitude from inverted flight of 100 feet (30 m) AGL.
When an aircraft is equipped with the Zvezda K-36DM ejection seat and the pilot is wearing the КО-15 protective gear, he is able to eject at airspeeds from 0 to 1,400 kilometres per hour (870 mph) and altitudes of 0 to 25 km (16 mi or about 82,000 ft).
The K-36DM ejection seat features drag chutes and a small shield that rises between the pilot's legs to deflect air around the pilot.
aviation.stackexchange.com/users/718/flyingfisch
Pilots have successfully ejected at negative altitudes in a handful of instances, after being forced to ditch in water.
Documented evidence exists that pilots of the US and Indian Navies have performed this feat.
Also: I once read, but cannot now locate, the citation awarded a pilot of the USAF for the world record lowest altitude successful (i.e. the pilot survived) emergency ejection from a stricken aircraft over land: sixteen feet below ground level.
Apparently the young pilot was practicing with his T-33 single-engine trainer when the engine flamed out and could not be restarted.
The pilot observed the flat desert below, crossed by several paved roads and highways.
One road seemed to be completely clear of traffic, so he opted for a gear-down dead-stick landing on it, hoping to minimize damage to the aircraft.
He discovered only after touchdown that the paved strip was not a road at all but a flash flood drainage ditch, wide enough for the fuselage but not the wings.
The aircraft was seriously damaged and set on fire.
The damage prevented the canopy from opening, so the pilot used the ejection seat to escape burning to death.
He survived with minor burns, some compression damage to his spine, and two broken ankles.
aviation.stackexchange.com/users/453/A. I. Breveleri
The Martin Baker MkGRU7 and EA7 on both the A6 Intruder and on the EA6B Prowler aircraft
have "zero-zero" capability, which means that the seats could be fired at zero AGL and zero airspeed.
aviation.stackexchange.com/users/4493/andy
Quite a few years back, about 28 to be exact
I worked on Mirage III service for the RAAF and one of my jobs
was to fit the ejection seats after major airframe servicing.
Originally they were fitted with Martin Baker OM6 and these seats were zero-90 classification.
They were powered by cartridges, basically a big multi stage canon that shot you out of the plane.
This means they were able to be used at zero altitude and 90 knots forward speed, the speed was purely to have enough air flow to open the chute fully but mostly to help with the removal of the canopy by blowing it backwards.
The canopy jettison would unlock the canopy and lift the front into the airstream, the forward motion would do the rest.
Later we made a modification to the seats to make them into zero/zero capability and this included fitting a rocket pack under the seat that would launch the seat to a safe height enough for the parachute to open normally.
In both cases the seats were capable of going through the canopy but normally the canopy would eject first except in the zero zero situation where the seat would go through the canopy.
aviation.stackexchange.com/users/8418/Nico
It all depends upon the seat type, altitude, speed, attitude and orientation of the aircraft during the ejection process.
Ejection seats just provide a velocity vector in order to give the pilot enough time to clear the crippled aircraft and deploy the recovery parachute, as this USAF training film shows.
This results in an envelope of airspeed, altitude, and attitude in which the seat can be activated allowing for a safe recovery.
For a so called 'Zero-Zero' ejection seat, it allows for a safe ejection from an aircraft on the ground in level flight attitude.
It does NOT guarantee safe ejection from an aircraft in unusual or inverted attitudes at low altitudes or airspeeds.
In the Boeing ACES II ejection seat a basic guide to seat characteristics is given here.
I can't comment on the capabilities of the Russian seats.
However the Russians do have a tendancy to be excessivly boastful and colorful with a gullible western press, such as the 1989 crash of a MiG-29 at the Paris Airshow, where the press ran with a story about the K36 seats being able to safely eject at low altitudes and extreme attitudes.
The reality was the seat in this incident was activated outside of its safety envelope; the pilot was just lucky he wasn't killed.
aviation.stackexchange.com/users/15637/Carlo Felicione
Is there generally a minimum altitude for ejecting in order for the sequence to function reliably (all the way to opening the chute, and slowing down to a survivable descent rate)? I've seen ejector seats test being done on the ground, don't know if there were actually test pilots in those seats though.   I assume all bets are off if you're not wings level (obviously a low-level inverted ejection has a 0% chance of success).
Is there a minimum altitude for ejection seats?
aviation.stackexchange.com
<military><ejection-seat>
aviation.stackexchange.com/questions/1439
aviation.stackexchange.com/users/2/falstro
It depends on the ejection seat. Older seats have different minimums. Modern  zero-zero ejection seats  are designed to be usable at zero speed, zero altitude.  Pilots have successfully ejected at negative altitudes  in a handful of instances, after being forced to ditch in water.   It depends on the seat type, modern seats can be deployed even at 0 altitude and 0 speed
Users tend to agree that it depends on the seat type. 