From what I understand, it should be possible to fully work out a deal over email, right?
Also, can you trade in a car with lots of problems? (It runs, but it has a bunch of leaks and failing parts)
Yes, it is possible to work out a deal without setting foot in the dealership. To go one step further, I wouldn't bother with any dealer who won't, and if they ask you why, simply answer "it's 2018."
I wanted a specific color/trim/transmission combination, but none were available locally. So I looked on Autotrader, found some within a couple hundred miles, communicated with those dealers using email and online chat, received firm price quotes, and offers on my trade-in. I then used those quotes when talking to my local dealer (via text messages to a salesperson I know) and hammered out the deal for the new car, trade-in, financing, and everything else. I didn't set foot in the dealer until the day I arrived to do the paperwork. Granted, I had the advantage of working with someone I knew, but even if I didn't have a friend at the dealer, it wouldn't have gone much differently. The only thing is, I ended up with a red GTI instead of black or grey like I wanted, but in hindsight, I'm happier with red than I would have been with the other 2.
As for your current car, you can trade in almost any car, though the value of said car to the dealer depends on many factors. In 2004, I was working at Honda dealer, where our used car manager took in a rather tired-looking 1996 Ford Contour for $1. Yes, you read that correctly. How much they offer for your car is going to depend largely on the year/age/mileage and cosmetic condition, which have the greatest effect on its book value. Depending on how your dealer's used car manager does things, any vehicle past a certain age may be automatically sent to the wholesale auction, and won't receive much more than a once-over before they offer you a small amount of money for it. Even the cars that the used car manager might want to put on the lot will rarely go up on a lift before they accept it on trade, because the dealer doesn't want to slow the sales process down on your new car. Besides, they're going to offer you thousands less than the actual resale value of the car, so they'll have enough to do some minor repairs and recondition it, and still turn a profit on it.
If your car is really old and beat, then clean it up as best you can, drive it down there, and see what they offer, assuming you just want to be rid of it. Keep in mind that if you decide to sell it privately, whatever money you put into repairing it before you sell will not be recouped by a higher selling price, unless you do all the repairs yourself using parts you got for free.
TL;DR: shop around online, don't get sucked into following their sales process, and research the value of your car before trading it in. Just out of curiosity, what sort of car are you getting rid of?