Well, in England the general rule has been, once a bastard always a bastard, with no inheritance rights - and as far as peerages are concerned, this still applies: a child born out of wedlock cannot inherit a title, even if the parents subsequently marry.
Kings of course, have broken their own laws when it suited them. The children of John of Gaunt and Katherine Swynford were legitimised to form the Beaufort line which led to Henry VII and the Tudor dynasty. Henry VIII bastardised both Elizabeth and Mary, then made them his heirs after Edward VI -without, intriguingly, legitimising either. Charles II was pressurised to legitimise his son, the Duke of Monmouth, when it became obvious he would be succeeded by his Roman Catholic brother, the Duke of York. He refused, possibly because (personal opinion) he believed he had no right to deprive his brother of his lawful onheritance.
So as far as the UK is concerned, the answer is a very qualified "yes" - but only rarely and only by sovereigns. As land was usually entailed on the nearest male blood relative, the owner was basically a life tenant, able to use the land but he could not give it to his favourite natural child at the expense of the lawful heir. He couldn't even give it to his daughters, who were dispossessed if they had no brother - see Jane Austen "Pride and Prejudice" and "Sense and Sensibility".