Yes, UK stamps (Royal Mail) work for mail to the Republic of Ireland—but the pricing and logic are specific.
Universal Postal Union (UPU) treaties obligate member states (UK and Ireland both members) to accept each other's postage. Common Travel Area history and Royal Mail's "International Standard" tariff treat Ireland as a distinct Europe zone—not "domestic," not "rest of world."
Forever stamps (1st/2nd class) cover domestic UK only. You need additional postage or international stamps for Ireland.
Northern Ireland (UK): domestic rates apply. Republic of Ireland: international rates. Same island, two postal administrations.