Please read this post by UK Parliament about healthcare abroad. It is full of essential information about the current system, which will most likely remain after Brexit.
https://publications.parliament.uk/pa/ld201719/ldselect/ldeucom/107/10705.htm#_idTextAnchor007