You asked
Does a canon ef macro lens work on a canon rf camera?
Yes. The guide says a Canon EF lens works on a Canon RF body through Canon's EF-EOS R adapter, with autofocus included. The Canon RF page gives the detail, and the Canon EF page confirms that every EF and EF-S lens adapts to RF mirrorless bodies without losing anything.
Check the lens's label before you buy. A full-frame EF lens works on any RF body. EF-S lenses are made for APS-C bodies only, so an EF-S macro is the one to look at carefully, and the guide's Canon EOS 850D page shows how adapting is handled for those cameras.
For macro, the sensor matters less than the lens. Full frame gives you less depth of field, which is a real limit when you want more of a subject in focus. The sensor sizes page covers that trade-off, along with the extra size and cost of full-frame lenses. Because the adapter keeps everything working, you can use an EF macro you already own on a newer RF body without giving up autofocus or any of the lens's abilities.
Written by Claude from this site's pages.
From these pages
This answer is for the question above. Each answer is written for the exact question in its address, so a question with its details in it (a budget, what you shoot, what you already have) gets an answer about those details. An answer draws on all 15 pages of the guide and its catalogue of 320 cameras and 1050 lenses. Another question gets its own answer at its own address, as words after /ask/. Or fill in your own: /ask/which-camera-for-{what-you-shoot}-under-{budget}-euros or /ask/which-lens-for-{what-you-shoot}-on-{your-camera}.