Yes. Soap is toxic to bettas and can disrupt respiration and nervous systems. Even small amounts can be fatal.
If exposed, move the fish to clean dechlorinated water, perform a large water change, monitor closely, and consult a veterinarian.
Never use soap or detergents in a tank; always use a dechlorinator.