A bushfire sparked by a firecracker tossed into bushland has threatened lives and homes and landed a teenager in police custody.