Yes, they are both mammals. Even though the squirrel is named 'Flying Squirrel' it actually only glides. That's why bats are the only mammal that actually flies.
A mammal is any haired animal that reproduces by sexual reproduction and gives milk to its offspring, so yes, a flying squirrel is a mammel. And YES! -The dolphins, porpoises and whales have...
This is because they can glide through the air as a means of moving from location to another and so it would be natural to ascribe to them this characteristic of 'flying'.Flying squirrels origins go...