A company that is VAT registered is simply an unpaid tax collector for the government. The VAT a company collects never belongs to the company. It is a tax on the buyer of the good or service.
If your company sells a VATable service or VATable goods to a customer, it will add VAT at 20% to the sale price so a good or service that has a sale price of £1,000 will have £200 of VAT added and the customer will pay £1,200 to your company.
If your company pays £400 for a VATable service or goods and the seller is VAT registered, VAT of £80 will be added to the purchase price and your company will pay £480 for the good or service to the supplier.
When your company completes its VAT return, the £80 input VAT it has paid its supplier will be deducted from the £200 output VAT it has collected from its customer and the difference of £120 will be paid to HM Revenue & Customs. In net terms, the company will be square.
It works in reverse. If your company's input VAT exceeds its output VAT, it will receive a repayment of the difference from HM Revenue & Customs. It will then be square.
Your understanding of the rules is correct. Take a look here
for some more examples.
I hope this helps but let me know if you have any further questions.