False pregnancy can affect a dog before she is spayed or after. This is when a dog exhibits mothering behavior such as nesting along with physical symptoms of pregnancy that include lactation. The mind has tricked the body into thinking it's pregnant, so it goes through the motions. While it's more common in intact ones, a recently spayed female can lactate.
Generally, dogs experience false pregnancy symptoms like lactating before being spayed. If the dog is in the throes of these symptoms while she is spayed, they may continue even after the operation -- false pregnancies generally last between two and three weeks, and end on their own without intervention. Even if your dog weren't lactating or showing other symptoms before being spayed, the hormonal change that accompanies the operation could send her into a false pregnancy immediately after, causing her to lactate for a few weeks after being spayed. If your dog is still showing this or other signs of a false pregnancy after three weeks' time, contact your veterinarian.