Would this work
Yes.
or would I have problems
Also yes.
I used to do this backing up my "servers". By that I mean some Raspberry Pis and random old PCs running Debian. I even did so successfully when needing to restore the images. But it was fragile and also failed at times, sometimes to great inconvenience when it was a machine serving something important.
I've since moved to a different backup strategy for servers, but if I were to do this with a bare-metal machine I want to preserve, I'd use something like Clonezilla. The maintainers of that project know a whole heck of a lot more than I do of the ins and outs of disk management, backup, and restoration than I do with my simple dd
commands. If it is something you're just wanting to do for fun and experience, dd
can work. If you're concerned with the security of your data/image, I'd use Clonezilla.