I have no leach experience, but I did try diving beetles. They don't stay in the tank like you think. I kept finding them all around the house. I wouldn't do it again.
That's true of just about all aquatic insects.
Leeches (not "leaches") are stupidly easy to keep in an established tank, as most of them are not bloodsuckers and subsist as scavengers, and can find plenty of food in any tank containing fish. They appeared spontaneously in my first outdoor pond, and when one snuck into the basement tanks on some plants I let him be. That was years ago, when he was maybe an inch long at maximum extension. Today he stretches out to about 5 or 6 inches. Beautiful graceful swimmer, but spends 99.9% of his time completely concealed. Not counting the times I expose him accidentally while moving stuff around in the tank, I probably only see him a couple times a year. His name, courtesy of my neighbour's kid...is Snot.
He has lived in several tanks since coming indoors, but mostly in an uncovered basement pond. Unlike beetles (not "beatles"
) he has never shown any inclination to go exploring.
So if you want to keep leeches, you might be well-advised to try some local aquatic variety rather than buying some exotic terrestrial species like Tiger Leeches. If you don't want to catch one yourself, you can get them at bait stores. Three gallons is small enough just as an aquarium; it would really start to get ridiculous if you tried to make it half-water, half-land for a terrestrial leech.