From the Super Mario Wiki, the Mario encyclopedia
Hat Trampolines are objects that appear in Super Mario Odyssey. They are red flowers that are closed when first seen, however, when Cappy is thrown at them, Mario captures/leads a Bullet Bill into one, Ground Pounds on one, or throws a Seed at one, they will open up. When Mario touches them in this state, they will launch him into the air, making him perform a Spin Jump in the air, similar to how Mario does a Spin Jump after jumping on a Spindrift in Super Mario 64 and Super Mario 64 DS. Some Hat Trampolines, primarily those seen in bonus areas, are open without having to throw Cappy at them.