You should probably ask about this in the specific phone forums.
ROMs are very device specific. Flashing a ROM intended for a different device, even the same device on a different carrier, will turn your phone into a very expensive door stop. This is commonly referred to as "bricking" your phone. I'm positive there are not yet any custom ROMs for either of these phones. It will take developers time to study the source code, modify it, and test and produce stable, custom ROMs.
In order to "flash" a custom ROM, you first need to "root" your phone. While you are waiting for custom ROMs and root processes to become available, read through the rooting forums for other recent htc and Samsung devices on your carrier. Things should be similar (but not identical) for the One and S4 once custom ROMs are available you'll be much more knowledgeable. Also read through the blog posts on A|C. You'll find explanations of what rooting is all about, and explanations of a lot of the terminology you'll encounter in the rooting forums.
Finally, be aware that rooting will almost certainly void your warranty, and if something goes wrong during the root process, or while flashing a ROM, that you can't recover from, neither the manufacturers nor carriers will have any sympathy. Be very sure you understand what you're doing before even thinking about doing this.
Now then, why do you want to flash a custom ROM? What do you expect it to do for you? Most of the things you need to jailbreak and iPhone to do, you can do on a stock, unrooted Android phone.