That's a big question that has more than one answer. For example you cannot replace an Intel Processor with an AMD one on a motherboard that is designed to take only Intel processors. Nor can you put an old 486 processor in place of a core 2 duo. You can't use DDR ram in a DDR2 slot etc. etc.
However if you buy the same device in a different country eg DDR2 ram from Germany, USA etc it will work in a UK purchased mother board.
There are exceptions of course, you have to be careful with power supplies which may be designed for 110V 60Hz and can't be used in Europe. Keyboards will also be designed to be language specific.
As I said, no short answer, it's all common sense.