I have kept my betta for 5 years now. However, one thing that I observed is that they should not be kept in any container smaller than 5 gallons (around 19 L).
A lot of stores use excuse that bettas live in puddles and other excuses like that to try to sell merchandise. However, I know from experience that bettas can't live in anything less than 5 gallons properly. They won't have enough space to swim, so they might start suffering from fat liver. The water quality very quickly becomes bad and starts to burn their gills.
Additionally, such small setup requires 100% water change at least every week, and that is extremely stressful for the fish. So please, no matter what you do, make sure your betta has at least 5 gallons and it will thank you. You will notice that they are very intelligent and each one has an unique personality. Some bettas will have too much space anxiety, so I would suggest size of anything from 5 to 10 gallons. My longest living betta is currently living in 15 gallon aquarium. Hope this helped.
Edit: encountering an opponent is actually good for bettas and will not stress them out (as long as they are the same age). Think of it as exercise that they need. I found my bettas to live longer and be much more interactive when they had small fish (like neon tetras) that they could chase. So if they have someone they can flare their gills at, all the better. So I say yes, definitely go for it. Your fish will thank you for it. Just make sure that the size of the tank is good and that you keep up with water changes.
The only problem would be if the age difference is big. If bettas are of same age, then they will flare and try to threaten each other. However, I noticed that when I put my 3 year old with a youngster, then the youngster actually hid all the way in the corner of the tank and was stressed. Same, however, is true if you put your bettas with big goldfish.