It’s not impossible, no, but it will take some legwork and may not be what you’re looking for.
Graduate school is not a chance to explore topics you didn’t get a chance to learn about in undergrad or basically continue taking classes just for fun (unless you’re independently wealthy, in which case rock on). Graduate school is for professional credentials: You get a degree that you need to enter some career field. A JD is obviously a law degree, intended to prepare you to pursue work as an attorney. And a PhD is a research degree, intended to prepare you for a career as a scholar in a particular area of inquiry. PhD students in history are almost always aspiring professors of history (and occasionally want to do non-academic work as a historian for, say, a museum or cultural institution).
Here’s the thing: many people are curious about many things. I majored in psychology and made my career (so far) in the field, but I am also fascinated by history, love music, am interested in languages and international affairs, and like physics and computer science. At some point you do have to make choices - you can’t pursue everything all at once. And it’s simply not practical to rack up degrees in a variety of fields and choose later. There are many different ways to pursue lifelong learning in other fields - you can live nearby universities and attend lectures in history and psychology, read books, join discussion groups, even audit classes. You can join professional groups in that area.
But you have to pick something. That doesn’t mean that you can never change careers or even blend two or three areas together (my current career is a blend of psychology and tech). But settle with something for a while.
That said, you said you’re a sophomore by credits but presumably it’s your first year in college. If you already know that you are disinterested in engineering careers, why major in it? Yes, an engineering degree can open doors, but the quantity of doors is not as important as the quality and nature of those opportunities. It doesn’t matter if there are dozens of jobs open to you if you don’t actually want to do any of them!
You can get a JD with any major (and in fact, patent and IP law is a lucrative area for a lawyer with an engineering background). However, for a history PhD you would need to take at least a minor in history and would be more competitive with something approaching a major (so 7-10 courses in the area).
That said, do realize that
-The academic job market in history (to be a history professor) is abysmal and only going to get worse. Many tenure-track, permanent full time positions as professors are being replaced by temporary professor positions without benefits or offices or job security. Good jobs - heck, even mediocre jobs - are getting 300-400+ applications for one job.
-There are limited jobs that are directly for PhDs in history. While PhDs in history can get lots of different jobs, the PhD in history only prepares you directly for a few of them.
-A history PhD takes on average 10 years to complete. You can probably do it in 6-8, but I’m just sharing the average. Then the JD takes an additional 3 years. So that’s a minimum of 9 additional years beyond college - being 32 before you can even start to think of turning outwards to career and saving for retirement.
And more importantly: Why on earth would you need a PhD in history and a JD? The only job that would necessitate the two would be to be a law professor, which is quite possibly even more competitive than history. You’d have to get both JD and PhD in history from very elite places to even have a shot.