You can legally bury your dog in your garden or yard.
I would recommend finding a spot away from your garden and bury the dog in a spot where you can place a memorial for the dog.
I've buried all my dogs that died in my own back yard without an issue.
In some places they have pet cemeteries, and you can even have the dog cremated and keep the dogs ashes in an urn.
But if you cannot afford to do that then you can simply dig a hole of around 3 to 4 feet deep in your yard and lay the dog down into the hole.
Then cover the dog up with dirt.
You can place a plastic bag over the dead dog but there's no requirement to do so.