Archimedes' principle is not valid in case of an elevator accelerating upwards, but it is valid for a car accelerating on a level road.
According to Archimedes' principle,
Buoyant force, B = Weight of the substituted liquid
Or,
B = mg
The above principle is satisfied in case of a car accelerating on a level road.
In case of an elevator, the buoyant force will be as below:
B = mg + ma (If the elevator is going upwards with an acceleration a)
Thus, Archimedes' principle is not valid in this case.