This is a bit more complicated than it used to be. If you're running Sonoma and are unable to drag your dock icons around like you always could before, go to System Settings > Accessibility > Pointer Control > then Click the Button to "Use Trackpad for Dragging" (until you see the Blue, which confirms you've turned it on) and then finally choose your "Dragging Style" (without Drag Lock is simplest). For some reason, our friends at Apple decided to set the option for "Use Trackpad for Dragging" to Off by default, so none of this is possible unless you navigate around as described above. I set up a new MacBook Pro today, updated to Sonoma 14.3.1, and that was the case for me. The simplest of all tasks, rearranging Dock icons, was impossible. The steps above immediately restored that useful functionality.
The only other nuance to be aware of is that you have to start your icon drag immediately after you "grab" the icon. If you wait just a half second, a pop-up menu will appear directly above the icon you want to move. That menu will give you various good and useful options (which vary based on the icon / app in question), but once that menu appears you've lost the chance to drag the icon. Just release the trackpad and grab the icon more quickly next time.
Hope this helps!