Hi, welcome to the forums.
You should be able to do this using the approach you outlined above. Are you sure that you moving the folders to the far right part of the dock? There is a separator bar that splits applications on the dock, and the stacks portion. It's faint, but it's a small dotted line. If you drag a folder to this section it should become a stack automatically.
Note, sometimes you have to pause and wait for the dock to accept the stack, especially if there are already folders in the stack section. Just hold the folder and hover over it for a bit and the dock should allow you to drop the folder into the section.