Yes, homemade mouthwash is safe.
In addition to controlling the ingredients you put into your recipe, you can also leave out preservatives and other harsh ingredients that many over-the-counter types of mouthwash contain.
Homemade mouthwash should cause you no harm unless you use them in high concentrations. If you’re concerned about using DIY mouthwash, talk with your dentist.
They will be able to look over a DIY recipe you’re looking to try and let you know if that’s safe or not.