Yes you can! It depends on the breed of your dog, their size, age and general health. This can be very personalised and it's best to talk to an expert about your pet.
As a general rule, puppies should have 5 minutes exercise for every month of their age, twice a day. Their bones are growing and their joints are developing so care needs to be taken.
Large dogs are more prone to joint issues so bear this in mind.
Senior dogs with existing conditions do need to exercise but this should be limited to only what they can manage.
If your dog has just had surgery, you must follow the instructions of your Vet closely. Dogs don't always know how much is too much.