Yep,
@arminnie is right - that's exactly how it works when I fly with mine.
Most airlines want you to call ahead - depending on the airline, they may ask you about the batteries in your scooter, so be prepared with that info. Check the airline's website first; there should be information there about how they handle mobility devices in general, and also how they handle batteries. My particular scooter has an easily removable battery, so I take it off the scooter, and it travels in the main cabin (in the overhead bin) with me in a travel bag.
Allow extra time if you are (like me) flying through an airport where you have a connecting flight - you will often find that your scooter comes off the plane fairly early, but it may take time for it to get "upstairs" to the jetway outside the plane. If you build in a bit of extra time between flights, you don't have to worry if it takes the ground crew a few extra minutes to get your scooter to you.
Last but not least: be (mentally) prepared for TSA - typically they will ask you to turn off - and then get off your scooter (if at all possible) and walk through. They will push your scooter through a gate, and it will be inspected, and "swabbed" separately. Do not leave anything on the scooter - everything besides you and the scooter must go through the x-ray in the bins provided, aside from medical equipment like a rollator, cane, or crutches. If you can't stand for long, be sure to let the TSA agent know that you can walk through the scanner, but will need to sit immediately after; they are usually really good about getting me a chair to sit on while they check the scooter.
I don't hesitate to fly at all - it really is quite easy, and I love bringing my own personal mobility device with me.