I moved my washer and dryer next to my electric water heater. I would like to know how close to the tank can I branch the hot and cold water lines. I would like to use a 3/4 to 1/2 inch reducer at the end of the 18" flex pipe, or at the tank before the flex pipe. Can this be done?
You can choke (reduce) the hot water line as close as you like, I suppose. Thread a 3/4-1/2 reducer right in the outlet if it makes you happy.
It's not a particularly wise thing to do, however. 1/2" pipe is not a good size for more than one or two fixtures - running everything in your house that uses hot water off one 1/2" pipe will cause your hot water pressure to be excessively low when several things need hot water at once. A 3/4" pipe is more than twice as large (revisit geometry, - .19 sq in .vs .44 sq inch) so it causes less flow restriction and pressure drop - which is why the common approach is to use a 3/4" line to feed 1/2" lines, rather than 1/2" lines everywhere.
If you'd like to branch the 1/2" lines off the 3/4" line "as soon as possible" you can certainly put multiple 1/2" branches right at the end of the 3/4 flex line. That is what many "Manifold" systems as commonly seen with PEX plumbing do.
I think what you are asking about is installing a T fitting either before or after the flex tubing. The short answer is yes. However, I recommend doing it after the flex (between the flex and the house plumbing) instead of before (between the flex and tank). The flex tubing lets the tank move a bit without breaking the house plumbing. It also allows the hot water heater to be easily replaced without having to touch the house plumbing. If you plumb in before the flex then you will have those problems on your new branch.