Where can I learn to safely deal with mains electricity?
That's sort of a vague question. You could go through a technical school for electricians and learn the general concepts of house wiring. The concept of AC rectification is probably all of two lectures in a 200 level college course.

The problem is that there isn't just one class, it's the class(es) leading up to that 200 level course. Even if you cover that, that's just the basics of turning AC into DC, you probably still wouldn't know enough. To get into switching loads and dimming lights would get into semiconductors, and that'll probably be a 3 or 400 level class. Basically ... it's not one class, it's a degree.

It's not a fun thing to say, but you probably should stick to commercial products for most of what you listed. AC-DC plug in adapters, commercial dimmers, etc if they're directly interfacing with household power, at least until you're done with your EE degree.