All perfectly legal, as long as it is properly secured in the compartment.
This has been performed by many airlines over the years. Some even have specially designed, seat-shaped bags which can be secured by the seatbelt (weight permitting). Other will fold the seats down flat and secure with nets/straps.