X7R and X5R are dielectrics of ceramic capacitors, these dielectrics describe the limit of tolerances over temperature span,
In both cases to see if suitable requires looking at the datasheet, as there are other parameters like voltage de-rating, e.g. the effective capacitance value is lower when the supply voltage is higher. this changes even between voltage ratings of the same series of caps, and sometimes a 5V cap is better than a 25V, as the higher voltage in the same package meant the derating curve was sacrificed to meet the spec.