The included angle of an Acme thread is 29 degrees vs. 60 degrees for a regular thread.
We had a job (before the days of CNC) where we needed to cut a square thread, and it had to start and stop in a specific location. The boss dug out an attachment for the B'Port that I didn't know we had, or that such a thing even existed. It was a horizontal rotary fixture that was geared off of the X axis lead screw. You took the handle off and put a gear on, and replaced the handle. By changing the gears, you could set the number of threads per inch. We cut the threads with an ordinary end mill, taking several cuts to get a smooth, accurate thread.
In a CNC, you use a thread mill, which can have any thread profile you want, and program the diameter and pitch.
I've cut male Acme threads on a lathe- even on a small lathe, but I always just bought a nut and modified it to suit. They sell a variety of Acme threaded nuts for various purposes. I'm not sure why you would need true square threads; Acme threads have been used for these purposes for a long time with excellent results. Places like McMaster-Carr have a wide variety of Acme threaded rod and nuts. I made a crossfeed screw for a lathe out of Acme threaded rod, and a bronze nut machined to fit the lathe.