Yes, but there will likely be an exit fee (Usually around £30-£40) for moving before your policy is due for renewal. Most insurers will give you a refund if you have not made any claims during the policy year and you have paid for your policy annually, but if you pay your policy monthly then you may not be entitled to any refund.
If you're thinking of changing policy before your renewal as you have seen a better deal, it may be better to wait until renewal once you weigh up the costs. Any saving your making on the new deal could effectively be cancelled out by the fees on your old deal. Compare the fees vs the savings that you may be making and see if it makes sense before switching.
It's also important to note that cancelling your direct debit does not cancel the policy and you will still owe your provider the premiums. To cancel your insurance, get in touch with your provider.