By legal, there could be two interpretations. The first one, is if it's legal in the legal sense - meaning, does it violate the sovereign law. The second, if it's against Jagex's terms of service.
For the first part, it may be best to question Law.SE, but generally speaking, the law where the customer is based tends to dictate the legality of the transaction. Depending on where you live, your mileage may vary.
For the second part, according to Jagex's Terms and Conditions:
YOUR ACCOUNT AND LICENSE
[...] You may not otherwise [...]Further you may not [...] or participate in any way whatsoever in any real-world trading
Which means it's not allowed by Jagex, and may have repercussions (such as account termination).