Yes it can be tapeworm but tapeworm are usually longer tha what you say they are so they can be that or maybe just dead heartworms I was once a veterinarian so it can be many things like
the p demon.
50 to 70 pounds
Dog do that sometimes if they are puppies or not they can breath heavily that happend to my dog and I was really scared
It depends on its size
It could be depressed try to give it a lot of attention it could work give it a try