Both are possible.
Depending on your router model it may cost you nothing. If it supports DD-WRT or OpenWRT firmware. If it does, both have the ability to act as a VPN server. I know OpenVPN setup on DD-WRT has decent documentation for setup but I'm sure other setups are as well. It is normally recommended to have a router with some decent hardware resources, just depends on what all you plan to do with the router.
A dedicated raspberry pi for the task probably is an easier method depending on your skill level working with routers.