regression method for data that contain a number of observation for several years I have a data set about 125 companies. For each company I have the salary and some other variables about the top 5 managers in each company. 
One observation contains the top 5 managers in each one of the 125 firms  from 2010 to 2018, so every company has the data for its managers for each year.
For some companies some years are missed or it is for less than top 5 managers.
I want to check the effect of a regulation that occurred in 2016, and my question is :

Is it OK to do linear regression for the observations before 2016 at once ?,
I am not sure about that because every year has the same companies with the data of that year.

Can anyone tell me if it is Ok to do that or help by advising another regression method
Hang on - so, what is the unit of analysis in your data set?  Is it companies, or is it managers?  Think carefully about this.  How are the "top 5" ranked?  Does the cohort change frequently?  What variables are you interested in with respect to policy impact?

It's true that from a company view, you've got a panel, but if there's enough churn in the management roster you could justify a pooled approach.  In addition, if the missing data is non-random (e.g., cyclic, confined to certain firms/sectors/etc), then it would bias a panel approach, and a pooled regression may be the best you can do.

It's down to the particulars of your data, which only you have access to.