The risks you mention are real.
For example can they access my home network (e.g. shared files)?
This depends on your setup. If possible you should put the VPN endpoint into a separate zone (i.e. a physically or at least logically separated network) where only access to the internet is allowed from this zone. This physical/logical separation of the machine from your local network is the recommended option.
If your router does not provide this option you might try to add appropriate firewall rules add the VPN endpoint (i.e. the RasPi) itself, in the hope that an attacker will not be able to compromise the machine and change the firewall rules.
The third option is to act like your home network is a public network where anybody has access, i.e. secure all of your devices against attacks from inside the local network. This is probably the hardest thing to do properly.
What if they use my home network for illegal activities which are illegal in my country?
If you are offering unlimited or insufficiently controlled access for others you might be liable. Just imagine that somebody sends a bomb threat through the connection you provide or publishes child porn. This is not only true for the case of a public VPN gateway but also if you create a public hotspot or let others use your network while they are in your home.
If you are personally liable for such things depends on the local law. But even with laws where you are not personally liable if others do illegal stuff in your local network you will at least get into lots of trouble in order to proof that you are personally innocent.
At least in case of creating public hotspots there are some providers which will take this risk from you in that they offer to route the potentially malicious traffic through their own infrastructure, i.e. essentially they are the VPN endpoint and not you. Of course, taking over this risk for you is usually not free.
What are the risks?
There are some more risks:
- You share your bandwidth with others which might affect your own access to the internet
- Since opinions might be expressed by using your network which are not liked by everybody the affected parties might try to shutdown the originating VPN. This will probably affect also your local internet access and maybe even you personally. Such shutdown attempts might be for example technical (i.e. DoS or trying to infect you with malware), legal (trying to force your ISP to disconnect you) but also kind of criminal (harassment, black mailing...).
Is there any way to do this without these concerns?
You might mitigate some risks. Others, like the liability, cannot be reduced much. You have to ask yourself how much do you trust your friends and if the remaining risk are worth it.