What Does The Law State?
According to Newton's first law of motion, "every object will remain at rest or in uniform motion in a straight line unless compelled to change its state by the action of an external force." This statement is used to define inertia. In simple words, no object changes its velocity until an external force is applied. This velocity might be zero for static objects and constant for dynamic ones.
Is It Valid In Different Frames?
We can understand this with a few actions. There are hand grips available in buses and trains hanging from its ceiling. If you notice, you will find them moving throughout the journey. Though its weight and tension in its strap are equal and acting opposite to each other and it should remain at rest, it doesn't happen. Why? It is because the train or bus is not moving at a uniform velocity. So, it is evident that the law doesn't apply to every framework.
If you consider the earth to be a framework, the law is applicable as it moves at a constant velocity. Similarly, for a bus moving at a constant velocity (which is practically impossible), the law is valid.
In A Nutshell
Considering the above (and other such actions, it can be said that a uniformly moving framework is a valid frame of reference while one moving at a non-uniform velocity is an invalid one. These are respectively called inertial and non-inertial frames of reference. For any further doubt on this, you can simply google 'physics tuition near me' and discuss it with your online physics teacher.