I can envision several scenarios where you might not be able to start school right away at a new university but could have the time to take a grad class at your undergrad university. Most of those involve family obligations.
You would have to ask the program where you are deferring admission directly if they would accept the transfer credit. It will likely depend on the course and the program. If you have a choice of courses, you could find out if any would have more likelihood of transferring than others and choose one that will transfer.
As for deferring admission and then deciding not to attend at all, I think that's a risk programs are aware of with deferred admission. If you had to pay a deposit to accept their offer or defer, you would forfeit your deposit. From a more ethical standpoint, if you are going to decline enrollment after a deferral, as soon as you know this is going to happen, let them know so they can admit another student into your slot. Programs always have waiting lists, so the sooner they know, the better it is all around for them to accept someone off their wait list.