It's quite obvious it went this way: agriculture, then domestication (since you need to provide food to domesticate animals), then milking, then cheese-making. There is no question that it was not a nomadic culture thing.
A large part of the domesticated animals bred in e.g. Norway (because I happen to be from there, not for any particular other reason) are bred largely independent of the agriculture.
Goats and sheep have been popular in Norway for a long time exactly because you don't need to provide food for them from a field you tended, but can send them out to graze in untended fields or in particular up in the mountains during the summer, and can if you don't have access to hay from a farm, collect hay/grass from untended fields to serve through winter. While there's certainly benefits to combining the two in climates like Norway where you need to collect a substantial food source for winter, even in Norway that was/is a convenience rather than a pre-requisite.
Up North, the Saami people have been nomadic for as long as we have recorded history of them, without any agricultural tradition, and some communities eventually took up herding and taming reindeer while continuing their nomadic lifestyle, following the migrations of the herds, in large part because while there's copious food for the reindeer, the soil and climate is not conducive to agriculture. They've largely done this without any nearby source of hay or other food from agriculture available at all.
Whether or not there's historical basis for saying agriculture came first or not, I don't know, but there are plenty of examples that shows that agriculture isn't required for domestication.
Raising cattle isn't presupposed on agriculture. It is possible to manage herds of cattle over a wide grazing area without having to tend to feed stock.