When we first got my wife’s diesel Colorado I researched this question too. They can be used, and are the same as what you’d buy from the store.
There were horror stories about getting bad DEF from pumps causing major damage, but it seems if you stick to high traffic stops that should be mitigated. We don’t travel out of town much, so I just empty a jug in whenever her light comes on.
Just buy you DEF in the large box containers, at any truck stop or gas station. That's the safest thing to do. It is all pretty cheap, and easy to find now.
The common logic in that world was that truck stops were the best place to get DEF. B/c of the constant turnover you are getting fresh DEF whenever you need to fill (and it's a bit cheaper...at least it used to be).