Age shouldn’t matter if they’re compatible.
Brain development is a real thing. Younger folks' brains just aren't developed enough and shouldn't be messed with by grown adults.
If we're talking about the difference between a 25 year old and a 35 year old, by all means, go ahead since both people are mentally and emotionally mature by then in most cases. Of course, there are instances when grown adults still aren't mentally and emotionally mature, but those are outliers.